Skip to content

Commit

Permalink
Removed gensim from tests due to it not supporting newer version of s…
Browse files Browse the repository at this point in the history
…cipy
  • Loading branch information
x-tabdeveloping committed Jul 1, 2024
1 parent 9fb42ec commit f9f0cb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: python3 -c "import sys; print(sys.version)"

- name: Install dependencies
run: python3 -m pip install --upgrade topic-wizard pytest bertopic turftopic gensim
run: python3 -m pip install --upgrade topic-wizard pytest bertopic turftopic

- name: Run tests
run: python3 -m pytest tests/
19 changes: 8 additions & 11 deletions tests/test_compatibility.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from bertopic import BERTopic
from gensim.corpora.dictionary import Dictionary
from gensim.models import LdaModel
from gensim.utils import tokenize
from sklearn.datasets import fetch_20newsgroups

import topicwizard
Expand All @@ -27,11 +24,11 @@ def test_bertopic():
app = topicwizard.get_dash_app(topic_data)


def test_gensim():
tokenized_corpus = [list(tokenize(text, lower=True)) for text in corpus]
dictionary = Dictionary(tokenized_corpus)
bow_corpus = [dictionary.doc2bow(text) for text in tokenized_corpus]
lda = LdaModel(bow_corpus, num_topics=10)
pipeline = gensim_pipeline(dictionary, model=lda)
topic_data = pipeline.prepare_topic_data(corpus)
app = topicwizard.get_dash_app(topic_data)
# def test_gensim():
# tokenized_corpus = [list(tokenize(text, lower=True)) for text in corpus]
# dictionary = Dictionary(tokenized_corpus)
# bow_corpus = [dictionary.doc2bow(text) for text in tokenized_corpus]
# lda = LdaModel(bow_corpus, num_topics=10)
# pipeline = gensim_pipeline(dictionary, model=lda)
# topic_data = pipeline.prepare_topic_data(corpus)
# app = topicwizard.get_dash_app(topic_data)

0 comments on commit f9f0cb0

Please sign in to comment.