Python 如何修复页面摘要器中的属性错误
尝试获取令牌时,在我的页面摘要器模型中获取属性错误,但不断获取错误,似乎看不出有任何错误Python 如何修复页面摘要器中的属性错误,python,python-3.x,machine-learning,Python,Python 3.x,Machine Learning,尝试获取令牌时,在我的页面摘要器模型中获取属性错误,但不断获取错误,似乎看不出有任何错误 def text(): for i in range(0,len(text_p)): text += text_p[i].text text = text.lower() # tokenize the text tokens =[t for t in text.split()] print(tokens) AttributeError回溯(最近一次呼叫上次)
def text():
for i in range(0,len(text_p)):
text += text_p[i].text
text = text.lower()
# tokenize the text
tokens =[t for t in text.split()]
print(tokens)
AttributeError回溯(最近一次呼叫上次)
在()
6.
7#标记文本
---->8个标记=[t表示text.split()中的t]
9打印(代币)
AttributeError:“函数”对象没有属性“拆分”
您正在使用函数名和变量名作为“文本”
更改变量名或函数名您的变量声明不清楚。。。请注意解释一下这段代码的用途以及每个变量的作用