Coder Social home page Coder Social logo

specificitytwitter's Introduction

SpecificityTwitter is a tool to predict sentence specificity of social media posts.

The dataset and models in this package are obtained using co-training as described in , AAAI 2019.

Citation and contact

Please cite the AAAI-19 paper: Gao et al., Predicting and Analyzing Language Specificity in Social Media Posts

@InProceedings{gao2019specificity,
  author    = {Gao, Yifan  and  Zhong, Yang  and  Preo\c{t}iuc-Pietro, Daniel  and  Li, Junyi Jessy},
  title     = {Predicting and Analyzing Language Specificity in Social Media Posts},
  booktitle = {Proceedings of AAAI},
  year      = {2019},
}

Dependencies

SpecificityTwitter is implemented using Python 3.6+. It depends on the following packages:

Our model was trained on a support vector regression model intergraded with scikit-learn. The last three packages together with the StanfordCoreNLP toolkit are required to generate features to be used in prediction.

Data and resources

Word lexicons for the models are available for download here. Please note that these resources come with license(s). Decompress the tar ball under the model directory.

Resources

There are several files in the resource folder.

  • Brown clusters (Turian et al., 2010)

    browncluster.txt

  • Concrete level (Brysbaert wt al., 2014)

    concrete.csv

  • GloVe Word Embedding trained on twitter posts (Pennington et al., 2014)

    glove.twitter.27B.100d.txt

  • Sentiment words from (Hu and Liu, 2004)

    negatie-words.txt

    positive-words.txt

  • Stanford NER tagger (Finkel et al., 2005)

    stanford-ner.jar

    english.muc.7class.distsim.crf.ser.gz

Running SpecificityTwitter

Call:

$ python specificity.py --inputfile inputfile --outputfile predfile
  • <inputfile> should consists of word-tokenized sentences, one sentence per line;
  • <predfile> will be the destination file which SpecicifityTwitter will write the specificity scores to, one score per line in the same order as sentences in <inputfile>.

The scores are decimal numbers ranging from 1 to 5, with 1.0 being most general and 5.0 being most specific.

Practical notes

  • Sentences must be word-tokenized before fed into this model.

  • Note that the word embedding file is a 1.2 GB file and should be downloaded from the above link. Each run of specificity.py will load the file to generate features. Thus it is best to avoid loading it multiple times, or modify feature.py and tailor it for your data loading purpose.

specificitytwitter's People

Contributors

tachyonftl avatar cs329yangzhong avatar jjessyli avatar

Watchers

James Cloos 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.