本文整理匯總了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)