Spaces:
Sleeping
Sleeping
import streamlit as st | |
from transformers import AutoModelForSequenceClassification, AutoTokenizer | |
# Loading model and tokenizer | |
model = AutoModelForSequenceClassification.from_pretrained("fyp-buglens/Reviews-hasBug-BB") | |
tokenizer = AutoTokenizer.from_pretrained("fyp-buglens/Reviews-hasBug-BB") | |
st.title("Bug Detection in Game Reviews") | |
# Input from the user | |
user_input = st.text_area("Enter a review") | |
if st.button("Analyze"): | |
inputs = tokenizer(user_input, return_tensors="pt", truncation=True) | |
outputs = model(**inputs) | |
prediction = outputs.logits.argmax().item() | |
# Display the result | |
if prediction == 1: | |
st.write("This review likely mentions a bug.") | |
else: | |
st.write("This review does not seem to mention a bug.") | |