Coder Social home page Coder Social logo

adilzouitine / pyfeel Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 7.0 429 KB

Python package for emotion analysis in French

License: MIT License

Python 100.00%
emotion-analysis python emotion nlp nlp-library data-analysis data-science data-mining opinion-mining

pyfeel's Introduction

pyFeel

pyFeel is a python library, it will make your emotion analysis in french easier. pyFeel computes seven emotions: positivity, joy, fear, sadness, anger, surprise, disgust with a bag of word method.

Installation

If you want to install it :

Requirements

  • Python 3
  • numpy : run pip install numpy
  • nltk : run pip install nltk
  • Don't forget to download nltk data [punkt] !!

Let's play now !

  • pyFeel : run pip install git+https://github.com/AdilZouitine/pyFeel --upgrade

PyPI

PyPI is coming ...


>>> from pyFeel import Feel
>>> test = Feel("Ma classe fonctionne bien, c'est sympathique non ?")
>>> test.emotions()
Out : {'positivity': 1.0, 'joy': 0.3333333333333333, 'fear': 0.0, 'sadness': 0.0, 'angry': 0.0, 'surprise': 0.0, 'disgust': 0.0}

For more information contact me: [email protected]

For the lexicon

Amine Abdaoui, Jérôme Azé, Sandra Bringay et Pascal Poncelet. FEEL: French Expanded Emotion Lexicon. Language Resources and Evaluation, LRE 2016, pp 1-23.

Bibliograpy

  • Ekman, P., 1992. An argument for basic emotions. Cognition & emotion 6, 169–200.
  • Mohammad, S.M., Turney, P.D., 2013. Crowdsourcing a Word-Emotion Association Lexicon. Computational Intelligence 29, 436–465.

pyfeel's People

Contributors

adilzouitine avatar embray avatar

Stargazers

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

Watchers

 avatar  avatar

pyfeel's Issues

Error : `Object arrays cannot be loaded when allow_pickle=False` when trying example

I ran the example in the repository description (given below)-

from pyFeel import Feel
test = Feel("Ma classe fonctionne bien, c'est sympathique non ?")
test.emotions()

And got this error (trace below) -

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-b6a3e1be6d31> in <module>
      1 from pyFeel import Feel
----> 2 test = Feel("Ma classe fonctionne bien, c'est sympathique non ?")
      3 test.emotions()

~/anaconda3/envs/py36/lib/python3.6/site-packages/pyFeel/pyFeel.py in __init__(self, text)
     33         dict_name = os.path.join(scriptpath, 'feel.npy')
     34 
---> 35         self.dict = np.load(dict_name).item()
     36         self.token = [word for word in word_tokenize(text.lower())]
     37         self.sentiment = {}

~/anaconda3/envs/py36/lib/python3.6/site-packages/numpy/lib/npyio.py in load(file, mmap_mode, allow_pickle, fix_imports, encoding)
    438             else:
    439                 return format.read_array(fid, allow_pickle=allow_pickle,
--> 440                                          pickle_kwargs=pickle_kwargs)
    441         else:
    442             # Try a pickle

~/anaconda3/envs/py36/lib/python3.6/site-packages/numpy/lib/format.py in read_array(fp, allow_pickle, pickle_kwargs)
    725         # The array contained Python objects. We need to unpickle the data.
    726         if not allow_pickle:
--> 727             raise ValueError("Object arrays cannot be loaded when "
    728                              "allow_pickle=False")
    729         if pickle_kwargs is None:

ValueError: Object arrays cannot be loaded when allow_pickle=False

Information about my environment-

python v3.6.12
nltk v3.5
numpy v1.19.1

Do you know what might be causing this?

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.