【短文本聚类】TextCluster:短文本聚类预处理模块 Short text cluster

点击上方,选择星标置顶,每天给你送干货

阅读大概需要5分钟

跟随小博主,每天进步一丢丢

整理:AINLP

推荐Github上一个NLP相关的项目:RandyPen/TextCluster

项目地址,阅读原文可以直达,欢迎参与和Star:
https://github.com/RandyPen/TextCluster

这个项目的作者是AINLP交流群里的昭鸣同学,该项目开源了一个短文本聚类工具,内存友好,速度不错,还不用尝试隐变量个数,欢迎使用。



以下来自该项目介绍页,点击阅读原文可以直达相关资源链接。

短文本聚类

项目介绍

短文本聚类是常用的文本预处理步骤,可以用于洞察文本常见模式、分析设计语义解析规范等。本项目实现了内存友好的短文本聚类方法。

依赖库

pip install tqdm jieba

使用方法

python cluster.py --infile ./data/infile \
--output ./data/output

具体参数设置可以参考cluster.py文件内_get_parser()函数参数说明,包含设置分词词典、停用词、匹配采样数、匹配度阈值等。

文件路径

TextCluster
|      README.md
|      LICENSE
|      cluster.py                    主要执行程序
|
|------utils                         公共功能模块
|    |    __init__.py
|    |    segmentor.py               分词器封装
|    |    similar.py                 相似度计算函数
|    |    utils.py                   文件处理模块
|
|------data
|    |    infile                     默认输入文本路径,用于测试中文模式
|    |    infile_en                  默认输入文本路径,用于测试英文模式
|    |    seg_dict                   默认分词词典
|    |    stop_words                 默认停用词路径

注:本方法仅面向短文本,长文本聚类可根据需求选用SimHash, LDA等其他算法。

Text Cluster

Introduction

Text cluster is a normal preprocess method to analysis text feature. This project implements a memory friendly method for short text cluster. For long text, it will be preferable to choose SimHash or LDA or others according to demand.

Requirements

pip install tqdm spacy

Usage

python cluster.py --infile ./data/infile_en \
--output ./data/output \
--lang en

File Structure

TextCluster
|      README.md
|      LICENSE
|      cluster.py                    main excutable function
|
|------utils                         utilities
|    |    __init__.py
|    |    segmentor.py               tokenizer wrapper
|    |    similar.py                 similarity calculator
|    |    utils.py                   file process module
|
|------data
|    |    infile                     default input file path, to test Chinese mode
|    |    infile_en                  default input file path, to test English mode
|    |    seg_dict                   default tokenizer dict path
|    |    stop_words                 default stop words path

Other Language

For other specific language, modify tokenizer wrapper in ./utils/segmentor.py.


方便交流学习,备注:昵称-学校(公司)-方向,进入DL&NLP交流群。

方向有很多:机器学习、深度学习,python,情感分析、意见挖掘、句法分析、机器翻译、人机对话、知识图谱、语音识别等。

记得备注呦

推荐阅读:

【ACL 2019】腾讯AI Lab解读三大前沿方向及20篇入选论文

【一分钟论文】IJCAI2019 | Self-attentive Biaffine Dependency  Parsing

【一分钟论文】 NAACL2019-使用感知句法词表示的句法增强神经机器翻译

【一分钟论文】Semi-supervised Sequence Learning半监督序列学习

【一分钟论文】Deep Biaffine Attention for Neural Dependency Parsing

详解Transition-based Dependency parser基于转移的依存句法解析器

经验 | 初入NLP领域的一些小建议

学术 | 如何写一篇合格的NLP论文

干货 | 那些高产的学者都是怎样工作的?

一个简单有效的联合模型

近年来NLP在法律领域的相关研究工作


让更多的人知道你“在看”

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值