French language support for TextBlob.
Project description
French language support for TextBlob.
Features
Part-of-speech tagging (PatternTagger)
Sentiment analysis (PatternAnalyzer)
Supports Python 2 and 3
Installing/Upgrading
If you have pip installed (you should), run
$ pip install -U textblob $ pip install -U textblob-fr
Usage
>>> from text.blob 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.
>>> from text.blob 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
True
Requirements
Python >= 2.6 or >= 3.3
TODO
Tokenization
Parsing
NLTK tagging?
License
MIT licensed. See the bundled LICENSE file for more details.
Changelog
0.1.0 (09/25/2013)
First release
Basically a thin, Py3-compatible wrapper around pattern.fr. Hooks to pattern’s tagger and sentiment analyzer.
0.0.1 (09/22/2013)
Experimental release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file textblob-fr-0.1.0.tar.gz
.
File metadata
- Download URL: textblob-fr-0.1.0.tar.gz
- Upload date:
- Size: 557.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5d7bc0798fc2ed6017abe89e8ae30b1010694879a5777ce8d31bd6bbbe83fb2 |
|
MD5 | fac53e49c45a430c35636dd2cffb46b3 |
|
BLAKE2b-256 | 055bbb376693acb5c135947b44a14c91d833d244a61e95d37ecae740c99b71b4 |
Provenance
File details
Details for the file textblob_fr-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: textblob_fr-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 561.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dcf027e1c68f67266d973e7cbe8df080ef3f049d096c2bc4dfff517ee734f80 |
|
MD5 | 5582672761ff62ce0e6643d74c3a25d4 |
|
BLAKE2b-256 | 992e2c1fa522a9cfb606c4c8dfafffbf79239762446f8a3d5f7788d8a2c1c473 |