Git Product home page Git Product logo

nlp-with-disaster-tweets's Introduction

NLP with Disaster Tweets

A challenge to build a machine learning model that predicts which Tweets are about real disasters and which one’s aren’t.

Model Architectures

- Bidirectional LSTM with 100D GloVe Embedding (Accuracy 82.3%)

model = Sequential()
model.add(Embedding(
    input_dim = embedding_matrix.shape[0],
    output_dim = embedding_matrix.shape[1],
    weights = [embedding_matrix],
    input_length = input_length
))
model.add(Bidirectional(LSTM(units = 64, return_sequences = True, recurrent_dropout = 0.2)))
model.add(GlobalMaxPool1D())
model.add(BatchNormalization())
model.add(Dropout(0.5))
model.add(Dense(units = 128, activation = "relu"))
model.add(Dropout(0.5))
model.add(Dense(units = 128, activation = "relu"))
model.add(Dropout(0.5))
model.add(Dense(units = 1, activation = 'sigmoid'))
model.compile(optimizer = 'rmsprop', loss = 'binary_crossentropy', metrics = ['accuracy'])

- Bert Model (Accuracy 83.8%)

input_ids = Input(shape = (60,), dtype = 'int32')
attention_masks = Input(shape = (60,), dtype = 'int32')    

output = model_layer([input_ids, attention_masks])[1]
output = Dropout(0.2)(output)    
output = Dense(units = 1, activation = 'sigmoid')(output)

model = Model(inputs = [input_ids,attention_masks],outputs = output)
model.compile(Adam(lr = learning_rate), loss = 'binary_crossentropy', metrics = ['accuracy'])

links

nlp-with-disaster-tweets's People

Contributors

keivanipchihagh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.