Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
rosenauer committed Apr 18, 2021
1 parent bdab678 commit 2055bd1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions backend/hardcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from docx import Document

def get_lst():
df = pd.read_excel('Sample_Questions_Compliance.xls')
df = pd.read_excel('backend/Sample_Questions_Compliance.xls')
lst = []

for index, row in df.iterrows():
lst.append((row['Model Question'], row['Additional Tags / Synonyms for questions (from QnA Chatbot)'],row['Model Answer']))

wordDoc = Document('Sample_Questions_Legal.docx')
wordDoc = Document('backend/Sample_Questions_Legal.docx')

for table in wordDoc.tables:
for row in table.rows:
Expand All @@ -18,8 +18,11 @@ def get_lst():
try:
int(cell.text)
except Exception as e:
if i in [0, 2]:
sub[i] = cell.text
if i in [0, 1]:
if i == 0:
sub[i] = cell.text
if i == 1:
sub[i+1] = cell.text
if cell.text != '':
i = i + 1
lst.append(tuple(sub))
Expand All @@ -39,4 +42,4 @@ def str_in_lst(quest, lst):



get_lst()
print(get_lst())

0 comments on commit 2055bd1

Please sign in to comment.