This repository contains a set of models for performing topic modeling on tweets from Surabaya.
1import joblib
2from gensim.models import FastText
3from huggingface_hub import hf_hub_download
4
5# Download and load the models
6REPO_ID = "Kiuyha/surabaya-opinion-tweet-clusters"
7kmeans_path = hf_hub_download(repo_id=REPO_ID, filename="kmeans.joblib")
8hf_hub_download(repo_id=REPO_ID, filename="fasttext.model.wv.vectors_ngrams.npy")
9fasttext_path = hf_hub_download(repo_id=REPO_ID, filename="fasttext.model")
10
11kmeans_model = joblib.load(kmeans_path)
12fasttext_model = FastText.load(fasttext_path)
13
14print(f"K-Means model loaded with {kmeans_model.n_clusters} clusters.")
15print(f"FastText model loaded with vector size {fasttext_model.vector_size}.")
16
17# You can now use these models for inference.