简体   繁体   English

赋值前引用的局部变量“引理”

[英]local variable 'lemma' referenced before assignment

Trying to perform sentiment anlysis with sentinet and having error 'local variable 'lemma' referenced before assignment' Can anyone help pout please?尝试使用 sentinet 执行情绪分析并在分配前引用错误“局部变量”引理”有人可以帮忙撅嘴吗?

below are the codes and the error log...thank you !以下是代码和错误日志...谢谢!

一个

一个

I can only guess - you have wrong indentation and you run lemma =... inside if not pos .我只能猜测 - 你有错误的缩进并且你在里面运行lemma =... if not pos

if not pos:
    continue
    lemma = ...

but it should be但应该是

if not pos:
    continue
lemma = ...

And the same problem is with synset and other code after third continue第三次continue后的synset和其他代码也存在同样的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM