简易 Pythonic 文本处理工具 TextBlob

码农软件 · 软件分类 · 常用工具包 · 2019-08-13 19:57:00

软件介绍

TextBlob 是一款 Pythonic 的文本处理工具,用于处理文本数据,它提供了一个简单的 API,用于潜入常见的自然语言处理(NLP)任务,如词性标注、名词短语提取、情感分析、分类、翻译等。

特性:

  • 名词短语提取

  • 词性标记

  • 情绪分析

  • 分类

  • 由 Google 翻译提供的翻译和检测

  • 标记(将文本分割成单词和句子)

  • 词句、短语频率

  • 解析

  • n-gram

  • 词变化(复数和单数化)和词形化

  • 拼写校正

  • 通过扩展添加新模型或语言

  • WordNet 集成

示例:

from textblob import TextBlob

text = '''
The titular threat of The Blob has always struck me as the ultimate movie
monster: an insatiably hungry, amoeba-like mass able to penetrate
virtually any safeguard, capable of--as a doomed doctor chillingly
describes it--"assimilating flesh on contact.
Snide comparisons to gelatin be damned, it's a concept with the most
devastating of potential consequences, not unlike the grey goo scenario
proposed by technological theorists fearful of
artificial intelligence run rampant.
'''

blob = TextBlob(text)
blob.tags           # [('The', 'DT'), ('titular', 'JJ'),
                    #  ('threat', 'NN'), ('of', 'IN'), ...]

blob.noun_phrases   # WordList(['titular threat', 'blob',
                    #            'ultimate movie monster',
                    #            'amoeba-like mass', ...])

for sentence in blob.sentences:
    print(sentence.sentiment.polarity)
# 0.060
# -0.341

blob.translate(to="es")  # 'La amenaza titular de The Blob...'

本文地址:https://codercto.com/soft/d/12300.html

改变未来的九大算法

改变未来的九大算法

[美] 约翰.麦考密克 / 管策 / 中信出版社 / 2013-6 / 39.00元

Google得出的搜索结果是如何产生的? 百度为何会陷入“搜索门”,又是什么机制使然? 身处在大数据时代的我们,究竟该如何应对变化莫测的世界? …… 没有满篇的专业术语,第一次让我们通过简单明了的语言、生动的例证了解支撑计算机王国的灵魂支柱——9大算法,包括人工智能、数据压缩,以及Google著名的PageRank等。 本书精彩地介绍了搜索引擎、PageRank、公开......一起来看看 《改变未来的九大算法》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具