Giter Club home page Giter Club logo

socialmediaclassification's Introduction

Real or Not? NLP with Disaster Tweets

I decided to publish my solution of corresponding competitions on Kaggle in this repository. The main idea of most notebooks is to extract new features to build ensemble in future.

TagsAsFeatures

As hashtags are popular in social networks, I decided to use them as features. During exploring I found that intersect of tags in train and in test sets isn't big. I tried to use stemming and lemmatization, but it didn't give anything. To build vector representation of each row I used CountVectorizer from sklearn. It was founded that the KNN can give as much more score than Random Forest on these features. You can find more details in the notebook.

TagsWithGlove

When I get a pretty bad result in the previous notebook, I decided that the main reason for it was small intersect of tags. So I used pre-trained GloVe vectors from Twitter. As some of the tweets have more than one tag, I used 'Math with Words' to get one vector. Using this approach, I raised the metric by 8 points and I used the same trick for locations. In this case, the KNN gave better results. More details.

VaderForFeatures

To get more features from tweets I used Vader. Vader (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool that is specifically attuned to sentiments expressed in social media. I expected to get a good correlation between new features and target, but it was not so. Only on this data, Random Forest was a little bit better than KNN. More details.

Bert

I just use pre-trained bert from SimpleTransformers. During some time of training it, I found good hyperparameters and found that better to use minimal data preprocessing. When I picked predictions of all models I realized, that predictions for Bert were in the wrong order. I think that the reason of this is a bug and after spending 2 days to fix it I didn’t succeed. So I decided to use an average of Bert's prediction and predictions that I plan to get from stacking. More details.

LSTM

To build a good ensemble I decided to use not pretrained Net with pretrained GloVe vectors. At this time, I tried just one model that I gave not bad predictions for sarcasm detection, but I want to try some other architectures for this task. The notebook with this approach. The model's script here.

To Do

Since the competition is not over yet, I plan to do:

  • Build ensemble.
  • Use FastAi's pre-trained LSTM.

socialmediaclassification's People

Contributors

koren-v avatar

Stargazers

Hanna Pylieva avatar

Watchers

 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.