├── README.md ├── requirements.txt └── app.py /README.md: -------------------------------------------------------------------------------- 1 | # OpenFact -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | streamlit 2 | 3 | streamlit_option_menu 4 | 5 | openai 6 | Image 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | import openai 2 | import streamlit as st 3 | from PIL import Image 4 | 5 | def load_image(img): 6 | im=Image.open(img) 7 | return im 8 | size=20 9 | 10 | st.markdown("

OpenFact 💬

", unsafe_allow_html=True) 11 | st.markdown("---") 12 | with st.sidebar: 13 | st.title("OpenFact") 14 | st.caption(''' 15 | OpenFact aims to provide solution to verify whether the fact is true or not. In this new world, we are surrounded with lots of information but all the facts on the web are not always true. OpenFact keeps you safe from the rumours and makes you always stand for the correct. 16 | ''', unsafe_allow_html=False) 17 | 18 | 19 | 20 | ques=st.text_area("Input the fact Here") 21 | button=st.button("Generate") 22 | 23 | 24 | 25 | def gen_auto_response(ques): 26 | openai.api_key=st.secrets["api"] 27 | 28 | response = openai.Completion.create( 29 | model="text-davinci-003", 30 | prompt=f"Fact is provided below\nFact:{ques}\nWhether the Fact is correct or not:\n\nNo, the fact is not correct. Mark Zuckerburg is the founder of the social media platform Facebook, but he did not build a computer.", 31 | temperature=0.7, 32 | max_tokens=256, 33 | top_p=1, 34 | frequency_penalty=0, 35 | presence_penalty=0 36 | ) 37 | print(response) 38 | return response.choices[0].text 39 | 40 | if ques and button: 41 | with st.spinner("-------Checking the Fact------"): 42 | reply=gen_auto_response(ques) 43 | st.write(reply) 44 | 45 | 46 | 47 | --------------------------------------------------------------------------------