问题描述
['VERB','NOUN','ADP','CCONJ','PUNCT']
#how to convert this list to this :
['VBG','NNS','IN','CC','NN','.']
** 我已经使用 spacy pos_ 编写了代码,但现在我的输入已更改为 tag_ **
解决方法
data = ['VERB','NOUN','ADP','CCONJ','PUNCT']
lookup = {
'ADP': 'IN','CCONJ': 'CC','NOUN': 'NNS','NOUN': 'NN','PUNCT': '.','VERB': 'VBG'
}
result = [ lookup[w] for w in data ]