pull
Browse files- app.py +18 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
pipe = pipeline(task="text-classification",model="yartyjung/Fake-Review-Detector")
|
5 |
+
|
6 |
+
st.title("Review-Detector")
|
7 |
+
text = st.text_input("your :red[suspicious] review here :sunglasses:",value="")
|
8 |
+
|
9 |
+
if text is not None:
|
10 |
+
predictions = pipe(text)
|
11 |
+
st.text(predictions)
|
12 |
+
if predictions[0]['label'] == 'fake':
|
13 |
+
for p in predictions:
|
14 |
+
st.subheader(f":red[FAKE] :blue[{ round(p['score'] * 100, 1)} %]")
|
15 |
+
elif predictions[0]['label'] == 'real':
|
16 |
+
for p in predictions:
|
17 |
+
st.subheader(f":green[REAL] :blue[{ round(p['score'] * 100, 1)} %]")
|
18 |
+
st.markdown(":red[***disclaimer*** This is a prediction by an _AI_, which might turn out incorrect.]")
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
transformers
|