Giter VIP home page Giter VIP logo

phpinsight's People

Contributors

exussum12 avatar hypejunction avatar isfonzar avatar jleagle avatar jwhennessey avatar toddnestor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phpinsight's Issues

Thanks!

Just wanted to drop you a note and thank you for open sourcing this great lib. It's helped me whip out a fun little tweet analysis tool for the MODX CMS, obviously also open sourced and GPL. Put up a quick demo on my site (which searches for "MODX" tweets): http://www.markhamstra.com/open-source/tweetalyzer/ and the source: https://github.com/Mark-H/Tweetalyzer

I did make some minor changes to your class, such as loading the data from a serialized php file instead of the database, nothing too shocking but if you would like to incorporate that, you can fetch it over from my repo.

Again, thanks for taking a lot of work from my hands :)

Negative Statement?

Hey, I have the following and I am wondering how I can help train the system. I feel like this is a positive statement, but it gave a negative response.

Kudos to Villanovense for not playing dirty

Any help would be great!

Returns wrong sentiment for PHP 7

This package used to work up well till we had PHP 5.6 but after we upgraded to PHP 7, phrases that were "neutral" are being returned as "positive". Not sure why?

All possible neutral phrases like:
"sample test line"
"maths in science"
"men and women in a line"

Any ideas

Stable release for Composer

Hi!

Could you please provide stable releases for your package? Your package can't be used with Composer if we have got "minimum-stability": "stable" in composer.json.

You will need to use tags and versioning.

Another language

Hi JWHennessey!

I want to use your the beautiful library for Spanish language. Can you write a small readme about internationalization dictionaries? Maybe have an article that I should study for this?

Use phpInsight for foreign languages

Hey there,

Just wondering if I can use this tool for foreign languages rather than English, and if so, I should build a list of positive/negative/neutral words/phrases manually, and add it within this tool, right? Just asking.

Thanks so much!

Totals add up to greater than 1.0

Are the combined, positive, negative, neutral scores supposed to total 1.0? I am seeing alot of this:

pos: 0.33333
neg: 0.66666
neu: 1.33333

or just

pos: 0.33333
neg:0.33333
neu:0.66666

Also I haven't seen one positve element yet but that may have to do with my data set compared to the provided dictionary.

Add new word doesnt work @JWHennessey/phpInsight

I just insert new word on your array negative word in lib/PHPInsight/dictionaries/source.neg.php, then i try to test it, output should be negative, but it doesn't work, it generates neutral.
Am i make any mistake step here ? and what is inside data folder ? do the data there still count to consider ?

I also try this method :
the word that i insert to lib/PHPInsight/dictionaries/source.neg.php (e.g. new-word), i insert it also on lib/PHPInsight/data/data.neg.php,
with change the value a:9095:{ -> a:9096:{
and add -> i:9095;s:10:"new-word"; before last }
it wont works.
Any suggestions please ?

Thanks for your help.

Data explanation

In the data folder, there's data like i:8419;s:21:"notveryspellbindingly"

I guess the i is simply the index, but what is the s ? how is it set ?

Also, some words in the dictionary appear more than once, like "isn't" in the prefix list... Is it made on purpose ? If yes, what ?

Thank you in advance :)

Project Continuation

I will like to continue this project and add features to it.

Please I need the design documentation to move on...

Have been trying to make pull request but I can't find any compare... Or how to go about this...

is it possible to add new languange

hi there, is it possible to add new language or add new negative/positive dictionaries ?
any clue how to do it ?
i'm newbies on this, thanks for your time give me explanation on this.

Getting warnings

Warning: Invalid argument supplied for foreach() in /phpInsight/sentiment.class.php on line 60
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /phpInsight/sentiment.class.php on line 88

Change to Other Algorithm

Hello Mr. JWHennessey

Is that possible to change naive bayes algorithm to other one? let say kNN (k nearest algorithm), or the other. If that can, in which part from the code should be changed? does it only in sentiment.php file or also data file?
Thank you..

Implementing multiple data sources?

I was thinking to try to go this; ability to switch between multiple data sources based on configuration (even maybe on language detection). What do you think from creators stand point about this?

Thanks

Spanish Dictionary

I want to use a spanish dictionary but I got some issues when parse the serialized object in sentiment class with charset and characters like ñ and á é í ó ú

any advice?

Example?

You should add a basic run-time example to the readme, project repo, or wiki page.

Please add the letter repetition

Could you add this feature to improve the score of each category if a letter is repeated?

FYI:
Repeating letters - if you look at the tweets, sometimes people repeat letters to stress the emotion. E.g. hunggrryyy, huuuuuuungry for 'hungry'. We can look for 2 or more repetitive letters in words and replace them by 2 of the same.

Link

Undefined variable $data

On line 265:

if(file_exists($data)){
$this->dataFolder = $dataFolder;
}
Shouldn't it be:
if(file_exists($dataFolder)){
$this->dataFolder = $dataFolder;
}

Surely `best` is positive?

Thanks so much for this - it's working very well for my requirements. I'm surprised to see that the word best is not in the positive dictionary, so the phrase the best in the world comes up as Neutral (score 0.333 for each class). Can you explain where the dictionary was pulled from, and would you accept a PR to fix this?

No nuetral

Is there a way to say neutral is actual positive..without just renaming the dictionary that it. i think most of the neutral words could be positive identifiers.

Support for other languages

Are there attempts to create PhpInsight compatible dictionaries for other languages ?
It would really be a big thing when someone shares dictionaries for PhpInsight on GitHub

Total positive, total negative - statistics

Hey there,

I'm trying to sum up everything after I categorized multiple texts, so I can see how much positives, negatives and neutral texts there are.
For example I have an array with 100 texts, each of those are listed into the table and sentiment for each is shown (like positive, negative or neutral), and what I want is at the end of the table to add something like statistics for everything, like total positives: 55, total negatives: 29, total neutral: 16

Any help about how I can do that please?

The general discussion sentiment

Hi (again ^^),

I'm using phpInsight to evaluate comment's sentiments, wich works fine... But what if I want to deduct the discussion's general sentiment, is that simply the average of it's comments ?

Somehow this doesnt feel right... what do you think ?

Get keyword that used for sentiment analysis

Hello, I would like to get the keyword that used for sentiment analysis after the categories and score is printed.
Something like:

String: This cake looks amazing
Dominant: positive, scores: Array
(
[positive] => 0.5 //keyword: amazing
[neutral] => 0.251
[negative] => 0.25
)

is there a way to do that?

Benchmark

I want to know the benchmark of this sentiment library you guys have produced. Some journals / publications would be appreciated. Also I want to know about the accuracy of the system on some annotated dataset. I would be really happy if guys help me. I will acknowledge you in my paper if I use your library.

Add Negation support

Example: "I don't like this movie."
Returns: positive

pos -- 0.49999999999962
neu -- 0.25000000000056
neg -- 0.24999999999981

A simple solution for this is to tag each word after the negation until the first punctuation (with for example NOT_).
The previous sentence will then become: “I don't NOT_like NOT_this NOT_movie”.

Here's a publication with lots of usefull information:
"Automatic Sentiment Analysis in On-line Text"
https://www.law.kuleuven.be/icri/publications/892138_elpub2007.content.pdf

Source of dictionary used in phpinsights

Hi, thanks for the awesome code. I am a student and i would like to ask about the source of the dictionary used in phpinsights. This is because i like to find out how is such a dictionary compiled. =)

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.