itub

We read every piece of feedback, and take your input very seriously.

文本挖掘和预处理工具(文本清洗、新词发现、情感分析、实体识别链接、关键词抽取、知识抽取、句法分析等),无监督或弱监督方法

Sow with little data seed, harvest much from a text field.

播撒几多种子词,收获万千领域实

HarvestText是一个专注无(弱)监督方法,能够整合领域知识(如类型,别名)对特定领域文本进行简单高效地处理和分析的库。适用于许多文本预处理和初步探索性分析任务,在小说分析,网络文本,专业文献等领域都有潜在应用价值。

使用案例:

【注:本库仅完成实体分词和情感分析,可视化使用matplotlib】

本README包含各个功能的典型例子,部分函数的详细用法可在文档中找到:

具体功能如下:

目录:

首先安装,使用pip

随后在代码中:

即可调用本库的功能接口。

上港 的 武磊 和 恒大 的 郜林 , 谁 是 中国 最好 的 前锋 ? 那 当然 是 武磊 武球王 了, 他 是 射手榜 第一 , 原来 是 弱点 的 单刀 也 有 了 进步

采用传统的分词工具很容易把“武球王”拆分为“武 球王”

词性标注,包括指定的特殊类型。

上港:球队 的:uj 武磊:球员 和:c 恒大:球队 的:uj 郜林:球员 ,:x 谁:r 是:v 中国:ns 最好:a 的:uj 前锋:位置 ?:x 那:r 当然:d 是:v 武磊:球员 武球王:球员 了:ul ,:x 他:r 是:v 射手榜:n 第一:m ,:x 原来:d 是:v 弱点:n 的:uj 单刀:术语 也:d 有:v 了:ul 进步:d

[0, 2] ('上海上港', '#球队#')[3, 5] ('武磊', '#球员#')[6, 8] ('广州恒大', '#球队#')[9, 11] ('郜林', '#球员#')[19, 21] ('前锋', '#位置#')[26, 28] ('武磊', '#球员#')[28, 31] ('武磊', '#球员#')[47, 49] ('单刀球', '#术语#')

这里把“武球王”转化为了标准指称“武磊”,可以便于标准统一的统计工作。

分句:

['上港的武磊和恒大的郜林,谁是中国最好的前锋?', '那当然是武磊武球王了,他是射手榜第一,原来是弱点的单刀也有了进步']

可以处理文本中的特殊字符,或者去掉文本中不希望出现的一些特殊格式。

包括:微博的@,表情符;网址;email;html代码中的 一类的特殊字符;网址内的%20一类的特殊字符;繁体字转简体字

例子如下:

在V0.7版修改,使用tolerance支持拼音相同的检查

把语句中有可能是已知实体的错误拼写(误差一个字符或拼音)的词语链接到对应实体。

本库采用情感词典方法进行情感分析,通过提供少量标准的褒贬义词语(“种子词”),从语料中自动学习其他词语的情感倾向,形成情感词典。对句中情感词的加总平均则用于判断句子的情感倾向:

sentiment dictionary威武:1.000000球员:0.000000上限:-1.000000

0.600000:武球王威武,中超最强球员!

默认使用的SO-PMI算法对于情感值没有上下界约束,如果需要限制在[0,1]或者[-1,1]这样的区间的话,可以调整scale参数,例子如下:

可以从文档列表中查找出包含对应实体(及其别称)的文档,以及统计包含某实体的文档数。使用倒排索引的数据结构完成快速检索。

刘关张之情谊,刘备投奔的靠山,以及刘备讨贼之经历尽在于此。

(使用networkx实现)使用Textrank算法,得到从文档集合中抽取代表句作为摘要信息,可以设置惩罚重复的句子,也可以设置字数限制(maxlen参数):

目前提供包括textrank和HarvestText封装jieba并配置好参数和停用词的jieba_tfidf(默认)两种算法。

现在本库内集成了一些资源,方便使用和建立demo。

资源包括:

此外,还提供了一个特殊资源——《三国演义》,包括:

大家可以探索从其中能够得到什么有趣发现😁。

加载清华领域词典,并使用停用词。

一些词语被赋予特殊类型IT,而“是”等词语被筛出。

从比较大量的文本中利用一些统计指标发现新词。(可选)通过提供一些种子词语来确定怎样程度质量的词语可以被发现。(即至少所有的种子词会被发现,在满足一定的基础要求的前提下。)

["武磊"]

算法使用了默认的经验参数,如果对结果数量不满意,可以设置auto_param=False自己调整参数,调整最终获得的结果的数量,相关参数如下:

比如,如果想获得比默认情况更多的结果(比如有些新词没有被发现),可以在默认参数的基础上往下调,下面的默认的参数:

这个 落叶球 踢 得 真是 666

这个:r 落叶球:术语 踢:v 得:ud 真是:d 666:新词

也可以使用一些特殊的规则来找到所需的关键词,并直接赋予类型,比如全英文,或者有着特定的前后缀等。

使用TextTiling算法,对没有分段的文本自动分段,或者基于已有段落进一步组织/重新分段。

可以本地保存模型再读取复用,也可以消除当前模型的记录。

本库主要旨在支持对中文的数据挖掘,但是加入了包括情感分析在内的少量英语支持。

需要使用这些功能,需要创建一个专门英语模式的HarvestText对象。

目前对英语的支持并不完善,除去上述示例中的功能,其他功能不保证能够使用。

本库正在开发中,关于现有功能的改善和更多功能的添加可能会陆续到来。欢迎在issues里提供意见建议。觉得好用的话,也不妨来个Star~

感谢以下repo带来的启发:

文本挖掘和预处理工具(文本清洗、新词发现、情感分析、实体识别链接、关键词抽取、知识抽取、句法分析等),无监督或弱监督方法

THE END
0.github.com/Admirepowered/APatch/commit/77bcb51082e99c7a411ddis_mounted $POINT; then + local BLOCK=$(find_block $PART) + mount $FLAG $BLOCK $POINT || return + fi + ui_print "- Mounting $POINT" +} + +# mount_ro_ensure +mount_ro_ensure() { + # We handle ro partitions only ihttps://github.com/Admirepowered/APatch/commit/77bcb51082e99c7a411dd5949c2c5e44e857e8bf.diff
1.JsonSource.AdditionalColumnsProperty(Azure.ResourceManagerDataFactoryPipelineReferenceType DataFactoryPipelineRunEntityInfo DataFactoryPipelineRunInfo DataFactoryPrivateEndpointConnectionCreateOrUpdateContent DataFactoryPrivateEndpointConnectionProperties DataFactoryPrivateEndpointProperties DataFactoryPrivateLinkResource DataFactoryPrivateLinkResourceProperties DataFactoryPublicNhttps://docs.microsoft.com/id-id/dotnet/api/azure.resourcemanager.datafactory.models.jsonsource.additionalcolumns?view=azure-dotnet
2.cvelistv5CVE2019CVE Details for CVE: CVE-2019-16905 Summary OpenSSH 7.7 through 7.9 and 8.x before 8.1, when compiled with an experimental key type, has a pre-authentication integer overflow if a client or server is configured to use a crafted XMSS key. This leads to memory corruption and local code exehttps://cvepremium.circl.lu/cve/CVE-2019-16905
3.mirrors.aliyun.com/CTAN/help/greek/gentle/gentlGi`a n`a xana\-epi\-str'e\-youme st`a {\rm roman}, gr'afoume st`on k'wdika {\tt \\rm}. Gi`a par'adeigma, e>~inai dunat`o n`a >'eqoume t`hn >ak'oloujh >agglik`h pr'otash st`on k'wdik'a mac: {\tt I started with roman type, \\it switched to italic https://mirrors.aliyun.com/CTAN/help/greek/gentle/gentl-gr.tex
4.Rockymyxstep1:curl https://raw.githubusercontent.com/dvershinin/apt-get-centos/master/apt-get.sh -o /usr/local/bin/apt-getstep2:chmod 0755 /usr/local/bin/apt-get 2020-10-13 17:38:29 680 原创 多机多卡技术测试-单节点多DCU(数据传输型)https://me.csdn.net/blink/qq_33562636
5.\inputmacfonthistorians aspire (Grundmann, p. 1; Guen\'{e}e, p. 25,\emph{et passim}).\bigskip The story of William Longsword provides a particularly good example of the conspiracy, supported by ecclesiastical and secular writers alike, to cook an embarassingly raw https://people.bu.edu/bobl/longsword.htm
6.西湖论剑2025Writeup(8,b'\x00'))addr32=lambdas:u32(io.recvuntil(s,drop=True,timeout=1).ljust(4,b'\x00'))addr64=lambdas:u64(io.recvuntil(s,drop=True,timeout=1).ljust(8,b'\x00'))byte=lambdan:str(n).encode()info=lambdas,n:print("\033[31m["+s+" -> "+str(hex(n))+"]\033[0m")sh=https://blog.xmcve.com/2025/01/19/%E8%A5%BF%E6%B9%96%E8%AE%BA%E5%89%91-2025-Writeup/
7.ffmpeg命令参数详解(二)ffmpegsimddct-target type specify target file type ("vcd", "svcd", "dvd", "dv", "dv50" , "pal-vcd", "ntsc-svcd", ) -xerror exit on error Advanced options: -map file:stream[:syncfile:syncstream] set input stream mapping -map_meta_data outfile:infile set meta data information of outfilehttps://m.blog.csdn.net/lbaihao/article/details/52138690
8.西湖论剑初赛Web1/5|r.content_type = "text/plain" local t = io.popen('/readflag') local a = t:read("*all") r:puts(a) if r.method == 'GET' then for k, v in pairs( r:parseargs() ) do r:puts( string.format("%s: %s\n", k, v) ) https://guokeya.github.io/post/qKqMPs-ml/
9.gcc.gnu.orgGitmsgstr "AltiVec-argumentti välitetty funktiolle, jolla ei ole prototyyppiä"#: config/s390/s390.c:16057-#, fuzzymsgid "Entity %qs at %L has a deferred type parameter and requires either the POINTER or ALLOCATABLE attribute"-msgstr ""https://gcc.gnu.org/git?p=gcc.git;a=commitdiff;h=47a665af3bc5bc14bff95f66b3a051a0c8d14fe1
10.InPartialFulfillmentB. t:.Íor::ís, "Tile Ilinship oj= iiad.¡ress in Poie' s Dunc-i-ad, " Phil-ologica'l Quart.erl 1' 51 Í îLJ'nJv ê "A: Í l\(L\n'9J¡nu1vn;aJrç! L972)? 8lg -gl. ¡ L6 The a-ccusat i ons road.e aga-_inst Theoh;,a_l-d are acl-al_:https://mspace.lib.umanitoba.ca/xmlui/bitstream/handle/1993/13283/Sheldon_The_meaning.pdf?sequence=1&isAllowed=y
11.[FFmpeg]ffmpeg命令参数详解(帮助说明)强大所有参数-target type specify target file type ("vcd", "svcd", "dvd", "dv", "dv50" , "pal-vcd", "ntsc-svcd", ) -xerror exit on error Advanced options: -map file:stream[:syncfile:syncstream] set input stream mapping -map_meta_data outfile:infile set meta data information of outfilehttps://www.cuplayer.com/player/playercodejs/2014/0711/1432.html
12.github.com/wikimedia/mediawiki/commit/d35cf1708f3bb730dce5c74", @@ -3145,7 +3145,7 @@ "watchlistedit-raw-titles": "Izenburuak:", "watchlistedit-raw-submit": "Jarraitze-zerrenda eguneratu", "watchlistedit-raw-done": "Zure jarraipen zerrenda berritu da.", - "watchlistedit-https://github.com/wikimedia/mediawiki/commit/d35cf1708f3bb730dce5c74e028754cbafdde9f1.patch
13.2024中国能源网络安全大赛②决赛个人赛wgf42420x000000007db0fc10160R--rwd \Device\HarddiskVolume1\Users\ctf\Desktop\777.png export file=mem.raw vol.py -f $file --profile=Win7SP1x64 dumpfiles -Q0x000000007db0fc10-D ./ flag{2shygsbnajwjji} Done | 代理流量 343 号包发现 frp https://www.cnblogs.com/wgf4242/p/18259556
14.typingfrom typing import TypeVar, Iterable, Tuple, Union S = TypeVar('S') Response = Union[Iterable[S], int] # Return type here is same as Union[Iterable[str], int] def response(query: str) -> Response[str]: T = TypeVar('T', int, float, complex) Vec = Iterable[Tuple[T, T]https://docs.python.org/id/3.8/library/typing.html
15.typingfrom typing import TypeVar, Iterable, Tuple, Union S = TypeVar('S') Response = Union[Iterable[S], int] # Return type here is same as Union[Iterable[str], int] def response(query: str) -> Response[str]: T = TypeVar('T', int, float, complex) Vec = Iterable[Tuple[T, T]https://docs.python.org/id/3.7/library/typing.html
16.26.1.typingfrom typing import TypeVar, Iterable, Tuple, Union S = TypeVar('S') Response = Union[Iterable[S], int] # Return type here is same as Union[Iterable[str], int] def response(query: str) -> Response[str]: T = TypeVar('T', int, float, complex) Vec = Iterable[Tuple[T, T]https://docs.python.org/id/3.6/library/typing.html
17.typingfrom collections.abc import Iterable from typing import TypeVar S = TypeVar('S') Response = Iterable[S] | int # Return type here is same as Iterable[str] | int def response(query: str) -> Response[str]: T = TypeVar('T', int, float, complex) Vec = Iterable[tuple[T, T]]https://docs.python.org/id/3.10/library/typing.html
18.从零开始学JAVA(经典)ystore "url","type" 其中: (1) keystore是保留字,表示keystore条目。 (2) url指kestore的URLng url, Properties info) throws SQLException public sta tic Connection getConnection(String url, Stringo.txt","rw"); //得到文件指针和长度 long flag = 0; lon g len = f.length(); //字符https://www.360doc.cn/document/53954678_1055815343.html
19.奇安信攻防社区union联合查询,用于合并左右两侧select语句的结果,得要求两侧select的列数相同,两侧select列数不同发生error,那注入就失败;因此 union注入必须得先进行order by的判断确定列数,后续才能拼接子查询测试。 所以,站点union注入失败的原因在于order by测试没命中 https://forum.butian.net/share/3708
20.bugku论剑场web解题记录lceFIre这里主要需要绕过第一个正则匹配,同时要令$result为真就能得到flag了\d+匹配多个数字字符s 特殊字符圆点 . 中包含换行符D 如果使用$限制结尾字符,则不匹配结尾换行;(详细可百度正则表达式修饰符)这里的/\d+/sD是用来匹配数字,只需字符串就可以绕过is_numeric() 函数用于检测变量是否为数字或数字字符串。https://www.cnblogs.com/lceFIre/p/11628512.html
21.github.com/wikimedia/mediawiki/commit/364f70d6ec6e546eece49007 @@ "prefs-info": "Коьртахаам", "prefs-i18n": "Кхинпараметраш", "prefs-signature": "Куьг", + "continuând cu vechea parolă.", "passwordreset-emailelement": "Nume de utilizator: \n$1\n\nParolă temporară: \n$2", "passwordresethttps://github.com/wikimedia/mediawiki/commit/364f70d6ec6e546eece4900a2754ac6dab79e995.patch