NEW_MODEL / app.py
13Aluminium's picture
Update app.py
9d71460 verified
raw
history blame contribute delete
458 Bytes
!pip install gensim
import streamlit as st
from gensim.models import FastText
# Load the trained FastText model
model_path = "fasttext_cs.model"
ft_model = FastText.load(model_path)
st.title("FastText Nearest Neighbors")
word = st.text_input("Enter a word:")
if word:
if word in ft_model.wv:
neighbors = ft_model.wv.most_similar(word, topn=10)
st.write(neighbors)
else:
st.write(f"Word '{word}' not found in vocabulary.")