如何取消标记此代码的输出?
班级核心:
def __init__(self, user_input):
pos = pop(user_input)
subject = ""
for token in pos:
if token.dep == nsubj:
subject = untokenize.untokenize(token)
subject = S(subject)
Run Code Online (Sandbox Code Playgroud)
我试过:https : //pypi.org/project/untokenize/
摩西去令牌器
。加入()
但是我的最后一个代码有这个错误(来自这篇文章):
TypeError: 'spacy.tokens.token.Token' object is not iterable
Run Code Online (Sandbox Code Playgroud)
.join() 的这个错误:
AttributeError: 'spacy.tokens.token.Token' object has no attribute 'join'
Run Code Online (Sandbox Code Playgroud)
对于 MosesDetokenizer: text = u" {} ".format(" ".join(tokens)) TypeError: can only join an iterable