mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Added BERTopic to Spacy Universe (#11159)
* Added BERTopic to Spacy Universe * Fix no render of visualization
This commit is contained in:
parent
2235e3520c
commit
1caa2d1d16
|
@ -544,6 +544,37 @@
|
|||
"website": "https://koaning.io"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bertopic",
|
||||
"title": "BERTopic",
|
||||
"slogan": "Leveraging BERT and c-TF-IDF to create easily interpretable topics.",
|
||||
"description": "BERTopic is a topic modeling technique that leverages embedding models and c-TF-IDF to create dense clusters allowing for easily interpretable topics whilst keeping important words in the topic descriptions. BERTopic supports guided, (semi-) supervised, hierarchical, and dynamic topic modeling.",
|
||||
"github": "maartengr/bertopic",
|
||||
"pip": "bertopic",
|
||||
"thumb": "https://i.imgur.com/Rx2LfBm.png",
|
||||
"image": "https://raw.githubusercontent.com/MaartenGr/BERTopic/master/images/topic_visualization.gif",
|
||||
"code_example": [
|
||||
"import spacy",
|
||||
"from bertopic import BERTopic",
|
||||
"from sklearn.datasets import fetch_20newsgroups",
|
||||
"",
|
||||
"docs = fetch_20newsgroups(subset='all', remove=('headers', 'footers', 'quotes'))['data']",
|
||||
"nlp = spacy.load('en_core_web_md', exclude=['tagger', 'parser', 'ner', 'attribute_ruler', 'lemmatizer'])",
|
||||
"",
|
||||
"topic_model = BERTopic(embedding_model=nlp)",
|
||||
"topics, probs = topic_model.fit_transform(docs)",
|
||||
"",
|
||||
"fig = topic_model.visualize_topics()",
|
||||
"fig.show()"
|
||||
],
|
||||
"category": ["visualizers", "training"],
|
||||
"author": "Maarten Grootendorst",
|
||||
"author_links": {
|
||||
"twitter": "maartengr",
|
||||
"github": "maartengr",
|
||||
"website": "https://maartengrootendorst.com"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "tokenwiser",
|
||||
"title": "tokenwiser",
|
||||
|
|
Loading…
Reference in New Issue
Block a user