Skip to main content

French language support for TextBlob.

Project description

Travis-CI

Experimental French language support for TextBlob.

Features

  • Part-of-speech tagging (PatternTagger)

  • Sentiment analysis (PatternAnalyzer)

  • Supports Python 2 and 3

Install

If you have pip installed (you should), run

$ pip install -U git+https://github.com/sloria/TextBlob.git@dev
$ pip install 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 (unreleased)

  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textblob-fr-0.0.1.tar.gz (557.2 kB view details)

Uploaded Source

Built Distribution

textblob_fr-0.0.1-py2.py3-none-any.whl (561.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file textblob-fr-0.0.1.tar.gz.

File metadata

  • Download URL: textblob-fr-0.0.1.tar.gz
  • Upload date:
  • Size: 557.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for textblob-fr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 714552bd226ad71fa55d779852957bd6fa392290e23baed05c0ed3229b916940
MD5 62bfecf0b7b9a8b7e2a997de48d8df3e
BLAKE2b-256 19d0c74d5cced9bd28d78a1eaa00dce90d912c08feb824f4eab89a8619317fe5

See more details on using hashes here.

Provenance

File details

Details for the file textblob_fr-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for textblob_fr-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 70397dc929e60d6d4ebbc0a980c91fa4ab4d4942d63a270f5469ce5700607791
MD5 d213c5590f0b10e2853a4014009bdb47
BLAKE2b-256 fdb701ef68b4a1689e738c3eb155d3a25a4685c223f1085231c2c30e3e62c244

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page