Skip to content

Instantly share code, notes, and snippets.

View Azure-rong's full-sized avatar

rongzhe Azure-rong

  • Sun Yat-Sen University
  • Guangzhou , China
View GitHub Profile
@Azure-rong
Azure-rong / Hellow latex.tex
Created September 5, 2014 08:32
latex:First Chinese latex file test
%hello_world.tex
\documentclass{book}
\usepackage{ctex}
\begin{document}
你好\LaTeX
\end{document}
@Azure-rong
Azure-rong / helpfulness prediction.py
Created March 25, 2014 06:00
Prediction examination:Predicting review helpfulness by using different classifier and find the best classifer. Then check feature subset prediction performance to find the most influence feature of review helpfulness
#! /usr/bin/env python2.7
#coding=utf-8
"""
Use scikit-learn to test different classifier's review helpfulness prediction performance, and test different feature subset's prediction performance
This module is the last part of review helpfulness prediction research.
"""
@Azure-rong
Azure-rong / pos neg(machine learning) feature.py
Created March 25, 2014 05:31
Feature extraction:Review sentiment probability score feature, use stored sentiment classifier to do it
#! /usr/bin/env python2.7
#coding=utf-8
"""
Use a stored sentiment classifier to identifiy review positive and negative probability.
This module aim to extract review sentiment probability as review helpfulness features.
"""
@Azure-rong
Azure-rong / store sentiment classifier.py
Last active April 26, 2016 20:53
Feature extraction:Review sentiment probability score feature, use natural language processing and machine learning technique (sentiment analysis)
#! /usr/bin/env python2.7
#coding=utf-8
"""
Use positive and negative review set as corpus to train a sentiment classifier.
This module use labeled positive and negative reviews as training set, then use nltk scikit-learn api to do classification task.
Aim to train a classifier automatically identifiy review's positive or negative sentiment, and use the probability as review helpfulness feature.
"""
@Azure-rong
Azure-rong / pos neg(senti dict) feature.py
Created March 24, 2014 03:30
Feature extraction:Review's positive/negative sumup, average and standard deviation score feature (Sentiment dictionary method)
#! /usr/bin/env python2.7
#coding=utf-8
"""
Compute a review's positive and negative score, their average score and standard deviation.
This module aim to extract review positive/negative score, average score and standard deviation features (all 6 features).
Sentiment analysis based on sentiment dictionary.
"""
@Azure-rong
Azure-rong / adj adv v feature.py
Last active March 6, 2017 23:09
Feature extraction:Review adjective, adverb and verb word's number
#! /usr/bin/env python2.7
#coding=utf-8
"""
Counting adjective words, adverbs and verbs number in the review.
This module aim to extract adjective words, adverbs and verbs number features.
"""
@Azure-rong
Azure-rong / entropy perplexity feature.py
Last active August 29, 2015 13:57
Feature extraction:Review's entropy and perplexity by building ngram language model
#! /usr/bin/env python2.7
#coding=utf-8
"""
Compute review's entropy and perplexity.
This module aim to bulid review ngram language model then compute review entropy and perplexity as features
"""
@Azure-rong
Azure-rong / name brand attribute feature.py
Last active August 29, 2015 13:57
Feature extraction:Review product name, brand and attribute appearing times feature
#! /usr/bin/env python2.7
#coding=utf-8
"""
Counting the product name, product brand and product attribute appear times in the review.
This module aim to extract product name, brand and attribute features.
"""
import textprocessing as tp
@Azure-rong
Azure-rong / word sentence length feature.py
Last active August 29, 2015 13:57
Feature extraction:Review word, sentence and review length features
#! /usr/bin/env python2.7
#coding=utf-8
"""
Counting review's word number, sentence number and review length
This module aim to extract review's word number and sentence number and review length features.
"""
import textprocessing as tp
@Azure-rong
Azure-rong / centroid feature.py
Last active August 29, 2015 13:57
Feature extraction:Review centroid score
#! /usr/bin/env python2.7
#coding=utf-8
"""
Compute review centroid score by combinating every word's tfidf score.
This module use filtered review data in a txt file and gensim tf-idf model to extract this review feature.
"""
import textprocessing as tp