Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sloria/textblob-fr
French language support for TextBlob.
https://github.com/sloria/textblob-fr
Last synced: 8 days ago
JSON representation
French language support for TextBlob.
- Host: GitHub
- URL: https://github.com/sloria/textblob-fr
- Owner: sloria
- License: mit
- Created: 2013-09-18T05:41:39.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-07-01T09:09:00.000Z (over 4 years ago)
- Last Synced: 2024-10-04T12:00:10.007Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 721 KB
- Stars: 58
- Watchers: 4
- Forks: 19
- Open Issues: 10
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
===========
textblob-fr
===========.. image:: https://badge.fury.io/py/textblob-fr.png
:target: http://badge.fury.io/py/textblob-fr
:alt: Latest version.. image:: https://travis-ci.org/sloria/textblob-fr.png?branch=master
:target: https://travis-ci.org/sloria/textblob-fr
:alt: Travis-CIFrench language support for `TextBlob`_.
Features
--------* Part-of-speech tagging (``PatternTagger``)
* Sentiment analysis (``PatternAnalyzer``)
* Supports Python 2 and 3Installing/Upgrading
--------------------If you have `pip `_ installed (you should), run ::
$ pip install -U textblob
$ pip install -U textblob-frUsage
-----
.. code-block:: python>>> from textblob import TextBlob
>>> from textblob_fr import PatternTagger, PatternAnalyzer
>>> text = u"Quelle belle matinée"
>>> blob = TextBlob(text, pos_tagger=PatternTagger(), analyzer=PatternAnalyzer())
>>> blob.tags
[(u'Quelle', u'DT'), (u'belle', u'JJ'), (u'matin\xe9e', u'NN')]
>>> blob.sentiment
(0.8, 0.8)Alternatively, you can use the ``Blobber`` class to avoid having to repeatedly pass the models into the ``TextBlob`` constructor.
.. code-block:: python
>>> from textblob import Blobber
>>> from textblob_fr import PatternTagger, PatternAnalyzer
>>> tb = Blobber(pos_tagger=PatternTagger(), analyzer=PatternAnalyzer())
>>> blob1 = tb(u"Quelle belle matinée")
>>> blob1.sentiment
(0.8, 0.8)
>>> blob2 = tb(u"C'est une voiture terribles.")
>>> blob2.sentiment
(-0.7, 0.6)
>>> blob1.analyzer is blob2.analyzer
TrueRequirements
------------- Python >= 2.6 or >= 3.3
TODO
----- Tokenization
- Parsing
- NLTK tagging?License
-------MIT licensed. See the bundled `LICENSE `_ file for more details.
.. _TextBlob: https://textblob.readthedocs.org/