malavika4089 commited on
Commit
ff1888c
·
verified ·
1 Parent(s): 94faa51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -12,13 +12,13 @@ import streamlit as st
12
  import requests
13
  import torch
14
 
15
- st.markdown("## Prediction of Fakeness by Given URL")
16
  background = Image.open('logo.jpg')
17
  st.image(background)
18
 
19
  st.markdown(f"### Article URL")
20
  text = st.text_area("Insert some url here",
21
- value="https://en.globes.co.il/en/article-yandex-looks-to-expand-activities-in-israel-1001406519")
22
 
23
  # @st.cache(allow_output_mutation=True)
24
  # def get_models_and_tokenizers():
@@ -81,11 +81,11 @@ tokens_info = tokenizer(concated_text, truncation=True, return_tensors="pt")
81
  with torch.no_grad():
82
  raw_predictions = model(**tokens_info)
83
  softmaxed = int(torch.nn.functional.softmax(raw_predictions.logits[0], dim=0)[1] * 100)
84
- st.markdown("### Fakeness Prediction")
85
  st.progress(softmaxed)
86
  st.markdown(f"This is fake by *{softmaxed}%*!")
87
  if (softmaxed > 70):
88
- st.error('We would not trust this text!')
89
  elif (softmaxed > 40):
90
  st.warning('We are not sure about this text!')
91
  else:
 
12
  import requests
13
  import torch
14
 
15
+ st.markdown("## Prediction of Misinformation by given URL")
16
  background = Image.open('logo.jpg')
17
  st.image(background)
18
 
19
  st.markdown(f"### Article URL")
20
  text = st.text_area("Insert some url here",
21
+ value="https://www.livelaw.in/news-updates/supreme-court-collegium-recommends-appointment-advocate-praveen-kumar-giri-judge-allahabad-high-court-279470")
22
 
23
  # @st.cache(allow_output_mutation=True)
24
  # def get_models_and_tokenizers():
 
81
  with torch.no_grad():
82
  raw_predictions = model(**tokens_info)
83
  softmaxed = int(torch.nn.functional.softmax(raw_predictions.logits[0], dim=0)[1] * 100)
84
+ st.markdown("### Truthteller Predicts..")
85
  st.progress(softmaxed)
86
  st.markdown(f"This is fake by *{softmaxed}%*!")
87
  if (softmaxed > 70):
88
+ st.error('We would not trust this text! This is misleading..')
89
  elif (softmaxed > 40):
90
  st.warning('We are not sure about this text!')
91
  else: