scattertext
A tool for finding distinguishing terms in small-to-medium-sized corpora, and presenting them in a sexy, interactive scatter plot with non-overlapping term labels. Exploratory data analysis just got more fun.
Example
import spacy from scattertext import SampleCorpora, produce_scattertext_explorer from scattertext import produce_scattertext_html from scattertext.CorpusFromPandas import CorpusFromPandas nlp = spacy.load('en_core_web_sm') convention_df = SampleCorpora.ConventionData2012.get_data() corpus = CorpusFromPandas(convention_df, category_col='party', text_col='text', nlp=nlp).build() html = produce_scattertext_html(corpus, category='democrat', category_name='Democratic', not_category_name='Republican', minimum_term_frequency=5, width_in_pixels=1000) open('./simple.html', 'wb').write(html.encode('utf-8')) print('Open ./simple.html in Chrome or Firefox.')
GitHubJasonKessler/scattertext
Categories visualizers
Found a mistake or something isn't working?
If you've come across a universe project that isn't working or is incompatible with the reported spaCy version, let us know by opening a discussion thread.
Submit your project
If you have a project that you want the spaCy community to make use of, you can suggest it by submitting a pull request to the spaCy website repository. The Universe database is open-source and collected in a simple JSON file. For more details on the formats and available fields, see the documentation. Looking for inspiration your own spaCy plugin or extension? Check out the project idea section in Discussions.