final-project / app.py
herztard's picture
input and cats
1505e07
raw
history blame
516 Bytes
import streamlit as st
from transformers import pipeline
@st.cache_resource
def load_model():
return pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
model = load_model()
st.title("Tag Detection from CNN News articles")
st.write("Enter a CNN News article URL.")
news_url = st.text_input("CNN Article URL:", placeholder="Example: https://edition.cnn.com/2024/12/19/science/stonehenge-monument-early-farmers/index.html")
categories = ["Politics", "Sports", "Weather", "Culture", "Crime"]