All Projects → maowankuiDji → Word2vec Sentiment

maowankuiDji / Word2vec Sentiment

基于Word2Vec+SVM对电商的评论数据进行情感分析

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Word2vec Sentiment

French Sentiment Analysis Dataset
A collection of over 1.5 Million tweets data translated to French, with their sentiment.
Stars: ✭ 35 (-46.97%)
Mutual labels:  sentiment-analysis
Meta Learning Bert
Meta learning with BERT as a learner
Stars: ✭ 52 (-21.21%)
Mutual labels:  sentiment-analysis
Sentiment analysis albert
sentiment analysis、文本分类、ALBERT、TextCNN、classification、tensorflow、BERT、CNN、text classification
Stars: ✭ 61 (-7.58%)
Mutual labels:  sentiment-analysis
Ml Classify Text Js
Machine learning based text classification in JavaScript using n-grams and cosine similarity
Stars: ✭ 38 (-42.42%)
Mutual labels:  sentiment-analysis
Oseti
Dictionary based Sentiment Analysis for Japanese
Stars: ✭ 49 (-25.76%)
Mutual labels:  sentiment-analysis
Doer
The implementation of ACL 2019 paper DOER: Dual Cross-Shared RNN for Aspect Term-Polarity Co-Extraction
Stars: ✭ 55 (-16.67%)
Mutual labels:  sentiment-analysis
Neural Networks
All about Neural Networks!
Stars: ✭ 34 (-48.48%)
Mutual labels:  sentiment-analysis
Deep Atrous Cnn Sentiment
Deep-Atrous-CNN-Text-Network: End-to-end word level model for sentiment analysis and other text classifications
Stars: ✭ 64 (-3.03%)
Mutual labels:  sentiment-analysis
Pattern
Web mining module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.
Stars: ✭ 8,112 (+12190.91%)
Mutual labels:  sentiment-analysis
Sentiment Analysis Nltk Ml Lstm
Sentiment Analysis on the First Republic Party debate in 2016 based on Python,NLTK and ML.
Stars: ✭ 61 (-7.58%)
Mutual labels:  sentiment-analysis
Machine Learning From Scratch
Succinct Machine Learning algorithm implementations from scratch in Python, solving real-world problems (Notebooks and Book). Examples of Logistic Regression, Linear Regression, Decision Trees, K-means clustering, Sentiment Analysis, Recommender Systems, Neural Networks and Reinforcement Learning.
Stars: ✭ 42 (-36.36%)
Mutual labels:  sentiment-analysis
Stocksight
Stock market analyzer and predictor using Elasticsearch, Twitter, News headlines and Python natural language processing and sentiment analysis
Stars: ✭ 1,037 (+1471.21%)
Mutual labels:  sentiment-analysis
Pyspider Stock
A project using pyspider to collect data and NLP techs to analyze the correlation among the data
Stars: ✭ 56 (-15.15%)
Mutual labels:  sentiment-analysis
Sentiment Analyser
ML that can extract german and english sentiment
Stars: ✭ 35 (-46.97%)
Mutual labels:  sentiment-analysis
Ram
A TensorFlow implementation for "Recurrent Attention Network on Memory for Aspect Sentiment Analysis"
Stars: ✭ 63 (-4.55%)
Mutual labels:  sentiment-analysis
Twitter Sentiment Analysis
Sentiment analysis on tweets using Naive Bayes, SVM, CNN, LSTM, etc.
Stars: ✭ 978 (+1381.82%)
Mutual labels:  sentiment-analysis
Text Classification Keras
📚 Text classification library with Keras
Stars: ✭ 53 (-19.7%)
Mutual labels:  sentiment-analysis
Text Analytics With Python
Learn how to process, classify, cluster, summarize, understand syntax, semantics and sentiment of text data with the power of Python! This repository contains code and datasets used in my book, "Text Analytics with Python" published by Apress/Springer.
Stars: ✭ 1,132 (+1615.15%)
Mutual labels:  sentiment-analysis
Repo 2017
Python codes in Machine Learning, NLP, Deep Learning and Reinforcement Learning with Keras and Theano
Stars: ✭ 1,123 (+1601.52%)
Mutual labels:  sentiment-analysis
Textblob Ar
Arabic support for textblob
Stars: ✭ 60 (-9.09%)
Mutual labels:  sentiment-analysis

Word2Vec-sentiment

基于Word2Vec+SVM对电商的评论数据进行情感分析

首先是利用word2vec对正负评论数据进行词向量训练,然后利用SVM分类器对语料进行分类,具体的过程如下:

第一步:加载数据、进行jieba分词、对数据进行随机切分,生成训练集和测试集(对应的代码部分为data_seal.py)

pos = pd.read_table('E:/NLP/chinese-w2v-sentiment/data/pos.csv',header=None,index_col=None)
neg = pd.read_table('E:/NLP/chinese-w2v-sentiment/data/neg.csv',header=None,index_col=None)
导入数据,然后利用jieba对数组进行分词,将分词结果与生成的相同维度的标签table数组进行合并,合并的方式有很多种:这里我用的是np.append(a,b,axis=0) 的方式。数据准备好了之后就是对数据进行切分,随机生成测试数据集和训练集,这里的比例test_size可以根据数据的实际大小进行设置,正常设置成0.2和0.3。
为了后面的运算方便,对切分的数据进行保存。分别为data文件下的x_train_data、x_test_data、y_train_data、y_test_data。

第二步:计算每段话的向量(代码对应的是word_vec.py和model.py)

通过遍历每句话中每个词的词向量,然后求均值,将均值表示为这一句话对应的向量,当然这里只是简单初级的处理,也可以参考doc2vec的方法对 句子进行向量化,但是工程应用上的效果不是特别好,大家也可尝试一下看看,这里毕竟只是初级的教程。

第三步:训练SVM模型(代码对应的是train_model.py)

第四步:对单个句子进行分类,情感判断(对应的代码为model_test.py)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].