Flair_NER/do_ner_task.py

17 lines
692 B
Python

#from inference import inference_main
from funcs import read_from_excel, add_columndata_to_excel,save_to_file_by_address
model = "orgcatorg/xlm-v-base-ner"
file_address = './data/sections.xlsx'
column_name = "ai_nlp_results"
sections = read_from_excel(file_address, column_name)
sections_ner = []
sections_list = ''
for index, section in enumerate(sections):
#ner_values = inference_main(model, section)
#sections_ner.append(ner_values)
sections_list = sections_list + section + '\n********************\n'
new_column_name = 'ai_nlp_results_2'
#add_columndata_to_excel(file_address, new_column_name, sections_ner)
save_to_file_by_address('./data/sections_text.txt',sections_list)