diff --git a/src/deepke/ner/regular/main.py b/src/deepke/ner/regular/main.py new file mode 100644 index 0000000..f961dd1 --- /dev/null +++ b/src/deepke/ner/regular/main.py @@ -0,0 +1,20 @@ +from bert import Ner +model = Ner("out_ner/") + +text= "Irene, a master student in Zhejiang University, Hangzhou, is traveling in Warsaw for Chopin Music Festival." +print("Text to predict Entity:") +print(text) +print('Results of NER:') + +result = model.predict(text) +for k,v in result.items(): + if v: + print(v,end=': ') + if k=='PER': + print('Person') + elif k=='LOC': + print('Location') + elif k=='ORG': + print('Organization') + elif k=='MISC': + print('Miscellaneous')