本文整理汇总了Python中pattern.text.Sentiment.load方法的典型用法代码示例。如果您正苦于以下问题:Python Sentiment.load方法的具体用法?Python Sentiment.load怎么用?Python Sentiment.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pattern.text.Sentiment
的用法示例。
在下文中一共展示了Sentiment.load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load
# 需要导入模块: from pattern.text import Sentiment [as 别名]
# 或者: from pattern.text.Sentiment import load [as 别名]
def load(self, path=None):
_Sentiment.load(self, path)
# Map "verschrikkelijk" to adverbial "verschrikkelijke" (+1%)
if not path:
for w, pos in dict.items(self):
if "JJ" in pos:
p, s, i = pos["JJ"]
self.annotate(attributive(w), "JJ", p, s, i)
示例2: load
# 需要导入模块: from pattern.text import Sentiment [as 别名]
# 或者: from pattern.text.Sentiment import load [as 别名]
def load(self, path=None):
_Sentiment.load(self, path)
# Map "terrible" to adverb "terribly" (+1% accuracy)
if not path:
for w, pos in list(dict.items(self)):
if "JJ" in pos:
if w.endswith("y"):
w = w[:-1] + "i"
if w.endswith("le"):
w = w[:-2]
p, s, i = pos["JJ"]
self.annotate(w + "ly", "RB", p, s, i)
示例3: load
# 需要导入模块: from pattern.text import Sentiment [as 别名]
# 或者: from pattern.text.Sentiment import load [as 别名]
def load(self):
_Sentiment.load(self)
for w, pos in self.items():
if "JJ" in pos:
# Map "verschrikkelijk" to adverbial "verschrikkelijke" (+1% accuracy)
self.setdefault(attributive(w), {"JJ": pos["JJ"], None: pos["JJ"]})
示例4: load
# 需要导入模块: from pattern.text import Sentiment [as 别名]
# 或者: from pattern.text.Sentiment import load [as 别名]
def load(self, path=None):
_Sentiment.load(self, path)