Closed ttran1904 closed 5 years ago
Can you run example.py file?
Yex, it works perfectly fine on example.py. But when I use it in my work file, it gives me the error.
Code: ` from io import open from vncorenlp import VnCoreNLP
lst = [] # list of texts I want to scan text = [] # tokenized word list. This is for later.
vn_stop = open('vn-stop.txt', 'r').read()
vncore_nlp =VnCoreNLP(annotators="wseg pos ner parse")
for i in lst:
# tokenize document string
tokens = vncore_nlp.tokenize(i.lower(), str=False)
# remove stop words from tokens
stopped_tokens = [i for i in tokens if not i in vn_stop]
# add tokens to list
texts.append(stopped_tokens)
`
Nevermind. I think I found the typo in my code. Thank you so much :)
I am using Python3 to run the word segmenter in VNCoreNLP. But I run into this error:
from vncorenlp import VNCoreNLP
I have already copied all the necessary files from VNCoreNLP (both java and python) into my work directory.