Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Commit

Permalink
feat: topic tren analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmaddynugroho committed Jun 30, 2023
1 parent 6c8462e commit 55d0508
Show file tree
Hide file tree
Showing 2 changed files with 371 additions and 0 deletions.
350 changes: 350 additions & 0 deletions notebook/tren.ipynb

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions notebook/tren.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from pickle import load
import pandas as pd

print('[INFO] preparing data')
df = pd.read_parquet('../dist/hp.parquet')

with open('../dist/dictionary.pickle', 'rb') as f:
dictionary = load(f)
with open('../dist/corpus.pickle', 'rb') as f:
corpus = load(f)
with open('../dist/model.pickle', 'rb') as f:
model = load(f)

print('[INFO] building corpus')
df['corpus'] = corpus

print('[INFO] building topics')
df['topics'] = model.get_document_topics(df['corpus'])

print('[INFO] saving df')
df.to_parquet('../dist/hpct.parquet')

0 comments on commit 55d0508

Please sign in to comment.