TA_1 / app.py
Dineth98's picture
Create app.py
a4c6c31
raw
history blame
455 Bytes
import streamlit as st
from transformers import pipeline
def summarize_text(text):
model = pipeline("text-classification", model = "cross-encoder/qnli-electra-base")
text_input = model(text)
return text_input
def main():
user_input = st.text_area("Input Text Here")
if st.button("Sentiment"):
summary = summarize_text(user_input)
st.write("Sentiment:")
st.write(summary)
if __name__ == "__main__":
main()