GithubHelp home page GithubHelp logo

anyachao1983 / nlp-algorithm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shangfr/embedding-analysis

0.0 0.0 0.0 46.83 MB

nlp分析工具是一款基于NLP开源算法和模型库(jieba、spacy、paddlenlp)对文本数据进行向量化,然后通过机器学习算法(聚类、主成分分析、图网络GraphicalLasso)对文本数据词向量之间进行关联性分析的小工具。

Python 20.22% JavaScript 62.76% HTML 17.02%

nlp-algorithm's Introduction

NLP分析工具

NLP分析工具是一款基于NLP开源算法和模型库(jieba、spacy、paddlenlp)对文本数据进行向量化,然后通过机器学习算法(聚类、主成分分析、图网络GraphicalLasso)对文本数据词向量之间进行关联性分析的小工具。前后端开发上用到了flask_api+js+bootstrap+echarts等组件,小工具涉及参数如下:

  • sentence :待分析文本,可编辑或上传txt文件
  • embedding :词向量模型选择(开源的词向量库)
  • cor :相关性度量方式(协方差矩阵、精度矩阵(偏相关))
  • xy :降维算法选择 ,Locally linear embedding(LLE)是一种非线性降维算法,它能够使降维后的数据较好地保持原有流形结构。
  • cluster :聚类算法选择,AP(非约束簇)- 与kmeans相比,不需要指定k值
  • topK :分析关键词的数量,默认20个,重要性从高到低排序
  • withWeight :每个关键词的权重

avatar

avatar

avatar

代码块

from word_net import WordNet
# 载入词向量模型
WordNet.load_model()
# 待分析文本
content = ''

# 分词,获取关键词
keywords = WordNet.word_cut(content,10)

# 词向量化
symbols,symbolSize,X = WordNet.word2vec(keywords,embedding = 'Spacy')
# 词向量矩阵转换--相关系数矩阵---偏相关系数矩阵---获取边
non_zero,d,cov_correlations = WordNet.x2cor(X)    
# 相关系数矩阵-聚类-获取类别标签
labels,categories = WordNet.apCluster(symbols,cov_correlations)

# 词向量矩阵-降维-可视化
xy = WordNet.xyDimension(X)
  

nlp-algorithm's People

Contributors

shangfr avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.