Git Product home page Git Product logo

fjlc's Introduction

fjlc's People

Contributors

draperunner avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

fjlc's Issues

Error in find_optimal_allocation

The find_optimal_allocation does not select non-overlapping phrases, nor does it select the longest one:

tweet = "you have a great day" # This is the most positive phrase in the lexica
lc.calculate_sentiment(tweet) # 7.087787200892932 - Strange, should be 5.0
lc.classifier.phrase_tree.find_optimal_allocation(tweet.split(" ")) # [['have', 'a', 'great'], ['a', 'great', 'day'], ['great']]
lc.classifier.phrase_tree.find_tracked_words(tweet.split(" ")) # [['you', 'have', 'a', 'great'], ['you', 'have', 'a', 'great', 'day'], ['have', 'a', 'great'], ['have', 'a', 'great', 'day'], ['a', 'great', 'day'], ['great']]

So find_tracked_words does find the the longest phrase, but does exclude it during the optimal token selection.

Possibly related: Adding exclamation mark does not change sentiment in some tweets:

lc.calculate_sentiment(tweet) # 7.087787200892932
lc.calculate_sentiment(tweet + "!") # 19.491414802455566  - As expected
tweet2 = "you have a very great day"
lc.calculate_sentiment(tweet2) # 10.233325457940143
lc.calculate_sentiment(tweet2 + "!") # 10.233325457940143 -  Should be 28.141645009335395?

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.