secondary line number display added
Browse files
app.py
CHANGED
|
@@ -226,7 +226,7 @@ if uploaded_pdf_file is not None:
|
|
| 226 |
st.rerun()
|
| 227 |
|
| 228 |
|
| 229 |
-
def contradiction_detection_for_sentence(cd_query):
|
| 230 |
query_encoding = encode_sentence(cd_query)
|
| 231 |
|
| 232 |
total_count = len(st.session_state.paragraph_sentence_encodings)
|
|
@@ -253,6 +253,7 @@ def contradiction_detection_for_sentence(cd_query):
|
|
| 253 |
st.write("master document page number ",
|
| 254 |
paragraph_from_sorted_paragraph_scores['original_text']['page_num'])
|
| 255 |
st.write("master document sentence: ", top_sentence[1])
|
|
|
|
| 256 |
st.write("secondary document sentence: ", cd_query)
|
| 257 |
|
| 258 |
st.write(contradiction_detection_result)
|
|
@@ -345,7 +346,7 @@ if 'paragraph_sentence_encodings' in st.session_state:
|
|
| 345 |
sentences = sent_tokenize(item[1])
|
| 346 |
for sentence in sentences:
|
| 347 |
# st.write(f"sententce {sentence}")
|
| 348 |
-
contradiction_detection_for_sentence(sentence)
|
| 349 |
# print(top_sentence[1])
|
| 350 |
# st.write(f"Similarity Score: {similarity_score}, Commonality Score: {commonality_score}")
|
| 351 |
# st.write("top_three_sentences: ", paragraph['top_three_sentences'])
|
|
|
|
| 226 |
st.rerun()
|
| 227 |
|
| 228 |
|
| 229 |
+
def contradiction_detection_for_sentence(cd_query, cd_query_line_number):
|
| 230 |
query_encoding = encode_sentence(cd_query)
|
| 231 |
|
| 232 |
total_count = len(st.session_state.paragraph_sentence_encodings)
|
|
|
|
| 253 |
st.write("master document page number ",
|
| 254 |
paragraph_from_sorted_paragraph_scores['original_text']['page_num'])
|
| 255 |
st.write("master document sentence: ", top_sentence[1])
|
| 256 |
+
st.write("secondary document line number", cd_query_line_number)
|
| 257 |
st.write("secondary document sentence: ", cd_query)
|
| 258 |
|
| 259 |
st.write(contradiction_detection_result)
|
|
|
|
| 346 |
sentences = sent_tokenize(item[1])
|
| 347 |
for sentence in sentences:
|
| 348 |
# st.write(f"sententce {sentence}")
|
| 349 |
+
contradiction_detection_for_sentence(sentence, item[0])
|
| 350 |
# print(top_sentence[1])
|
| 351 |
# st.write(f"Similarity Score: {similarity_score}, Commonality Score: {commonality_score}")
|
| 352 |
# st.write("top_three_sentences: ", paragraph['top_three_sentences'])
|