Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1385,7 +1385,8 @@ def getLinearTextualContextFromTriples(word,labelTriplesLIST, text_splitter, arg
|
|
1385 |
min_threshold=0.7)
|
1386 |
|
1387 |
if not df_retrieved.empty:
|
1388 |
-
labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
|
|
1389 |
labelTriplesAPP = ". ".join(
|
1390 |
" ".join(str(element).capitalize() for element in triple) for triple in labelTriplesLIST_RAGGED)
|
1391 |
|
@@ -1418,7 +1419,8 @@ def getLinearTextualContextFromTriples(word,labelTriplesLIST, text_splitter, arg
|
|
1418 |
|
1419 |
df_retrieved = df_retrievedtopk.copy()
|
1420 |
if not df_retrieved.empty:
|
1421 |
-
labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
|
|
1422 |
if not Oinnerlistiterative:
|
1423 |
Oinnerlistiterative=labelTriplesLIST_RAGGED
|
1424 |
else:
|
@@ -1430,7 +1432,8 @@ def getLinearTextualContextFromTriples(word,labelTriplesLIST, text_splitter, arg
|
|
1430 |
|
1431 |
df_retrieved = df_retrievedtopk.copy()
|
1432 |
if not df_retrieved.empty:
|
1433 |
-
labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
|
|
1434 |
if not Oinnerlistiterative:
|
1435 |
Oinnerlistiterative = labelTriplesLIST_RAGGED
|
1436 |
else:
|
@@ -1470,7 +1473,8 @@ def getLinearTextualContextFromTriples(word,labelTriplesLIST, text_splitter, arg
|
|
1470 |
#
|
1471 |
# df_retrieved = df_retrievedtopk.copy()
|
1472 |
# if not df_retrieved.empty:
|
1473 |
-
# labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
|
|
1474 |
# labelTriplesAPP = ". ".join(" ".join(str(element).capitalize() for element in triple) for triple in labelTriplesLIST_RAGGED)
|
1475 |
#
|
1476 |
# if not labelTriples:
|
@@ -1483,7 +1487,8 @@ def getLinearTextualContextFromTriples(word,labelTriplesLIST, text_splitter, arg
|
|
1483 |
#
|
1484 |
# df_retrieved = df_retrievedtopk.copy()
|
1485 |
# if not df_retrieved.empty:
|
1486 |
-
# labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
|
|
1487 |
# labelTriplesAPP = ". ".join(" ".join(str(element).capitalize() for element in triple) for triple in labelTriplesLIST_RAGGED)
|
1488 |
# if not labelTriples:
|
1489 |
# labelTriples = labelTriplesAPP
|
@@ -1494,7 +1499,7 @@ def getLinearTextualContextFromTriples(word,labelTriplesLIST, text_splitter, arg
|
|
1494 |
# labelTriples.strip().replace("..",".").strip()
|
1495 |
|
1496 |
|
1497 |
-
else: # NO RAG on triples
|
1498 |
labelTriples = ". ".join(" ".join(str(element).capitalize() for element in triple) for triple in labelTriplesLIST)
|
1499 |
|
1500 |
|
|
|
1385 |
min_threshold=0.7)
|
1386 |
|
1387 |
if not df_retrieved.empty:
|
1388 |
+
#labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
1389 |
+
labelTriplesLIST_RAGGED = df_retrieved['Passages'].apply(lambda x: (x,)).tolist()
|
1390 |
labelTriplesAPP = ". ".join(
|
1391 |
" ".join(str(element).capitalize() for element in triple) for triple in labelTriplesLIST_RAGGED)
|
1392 |
|
|
|
1419 |
|
1420 |
df_retrieved = df_retrievedtopk.copy()
|
1421 |
if not df_retrieved.empty:
|
1422 |
+
#labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
1423 |
+
labelTriplesLIST_RAGGED = df_retrieved['Passages'].apply(lambda x: (x,)).tolist()
|
1424 |
if not Oinnerlistiterative:
|
1425 |
Oinnerlistiterative=labelTriplesLIST_RAGGED
|
1426 |
else:
|
|
|
1432 |
|
1433 |
df_retrieved = df_retrievedtopk.copy()
|
1434 |
if not df_retrieved.empty:
|
1435 |
+
#labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
1436 |
+
labelTriplesLIST_RAGGED = df_retrieved['Passages'].apply(lambda x: (x,)).tolist()
|
1437 |
if not Oinnerlistiterative:
|
1438 |
Oinnerlistiterative = labelTriplesLIST_RAGGED
|
1439 |
else:
|
|
|
1473 |
#
|
1474 |
# df_retrieved = df_retrievedtopk.copy()
|
1475 |
# if not df_retrieved.empty:
|
1476 |
+
# #labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
1477 |
+
# labelTriplesLIST_RAGGED = df_retrieved['Passages'].apply(lambda x: (x,)).tolist()
|
1478 |
# labelTriplesAPP = ". ".join(" ".join(str(element).capitalize() for element in triple) for triple in labelTriplesLIST_RAGGED)
|
1479 |
#
|
1480 |
# if not labelTriples:
|
|
|
1487 |
#
|
1488 |
# df_retrieved = df_retrievedtopk.copy()
|
1489 |
# if not df_retrieved.empty:
|
1490 |
+
# #labelTriplesLIST_RAGGED = df_retrieved.to_records(index=False).tolist()
|
1491 |
+
# labelTriplesLIST_RAGGED = df_retrieved['Passages'].apply(lambda x: (x,)).tolist()
|
1492 |
# labelTriplesAPP = ". ".join(" ".join(str(element).capitalize() for element in triple) for triple in labelTriplesLIST_RAGGED)
|
1493 |
# if not labelTriples:
|
1494 |
# labelTriples = labelTriplesAPP
|
|
|
1499 |
# labelTriples.strip().replace("..",".").strip()
|
1500 |
|
1501 |
|
1502 |
+
else: # NO RAG on triples
|
1503 |
labelTriples = ". ".join(" ".join(str(element).capitalize() for element in triple) for triple in labelTriplesLIST)
|
1504 |
|
1505 |
|