KarthickAdopleAI commited on
Commit
148ef88
·
1 Parent(s): 2813025

Upload 3 files

Browse files
COVID19_FAQ - COVID19_FAQ.csv ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ questions,answers
2
+ 1. How does COVID-19 spread?,"People can catch COVID-19 from others who have the virus. The disease can spread from person to person through small droplets from the nose or mouth which are spread when a person with COVID-19 coughs or exhales. These droplets land on objects and surfaces around the person. Other people then catch COVID-19 by touching these objects or surfaces, then touching their eyes, nose or mouth. People can also catch COVID-19 if they breathe in droplets from a person with COVID-19 who coughs out or exhales droplets. This is why it is important to stay more than 1 meter (3 feet) away from a person who is sick."
3
+ 2. What are the symptoms of COVID-19?,"The most common symptoms of COVID-19 are fever, tiredness, and dry cough. Some patients may have aches and pains, nasal congestion, runny nose, sore throat or diarrhea. These symptoms are usually mild and begin gradually. Some people become infected but dont develop any symptoms and don't feel unwell. Most people (about 80%) recover from the disease without needing special treatment. Around 1 out of every 6 people who gets COVID-19 becomes seriously ill and develops difficulty breathing. Older people, and those with underlying medical problems like high blood pressure, heart problems or diabetes, are more likely to develop serious illness. People with fever, cough and difficulty breathing should seek medical attention."
4
+ 3. How do I know if it is COVID-19 or just the common flu?,"A COVID-19 infection has the same signs and symptoms as the common cold and you can only differentiate them through laboratory testing to determine the virus type. If you have fever, cough and difficulty breathing, you should seek medical attention and immediately isolate yourself from others. Call your local UN clinic/medical facility to inform them of your condition and relevant travel/exposure history. If you had been identified as a close contact of a case by the local Ministry of Health or WHO, please also indicate this. From here you will be advised if a medical assessment is necessary and how to get tested."
5
+ 4. Can the virus that causes COVID-19 be transmitted through the air?,Studies to date suggest that the virus that causes COVID-19 is mainly transmitted through contact with respiratory droplets rather than through the air.
6
+ 5. What can I do to protect myself and prevent the spread of disease?,"Protection measures for everyone Stay aware of the latest information on the COVID-19 outbreak, available on the WHO website and through your national and local public health authority. Many countries around the world have seen cases of COVID-19 and several have seen outbreaks. Authorities in China and some other countries have succeeded in slowing or stopping their outbreaks. However, the situation is unpredictable so check regularly for the latest news. You can reduce your chances of being infected or spreading COVID-19 by taking some simple precautions: Regularly and thoroughly clean your hands with an alcohol-based hand rub or wash them with soap and water. Why? Washing your hands with soap and water or using alcohol-based hand rub kills viruses that may be on your hands. Maintain at least 1 meter (3 feet) distance between yourself and anyone who is coughing or sneezing. Why? When someone coughs or sneezes, they spray small liquid droplets from their nose or mouth which may contain virus. If you are too close, you can breathe in the droplets, including the COVID-19 virus if the person coughing has the disease. Avoid touching eyes, nose and mouth. Why? Hands touch many surfaces and can pick up viruses. Once contaminated, hands can transfer the virus to your eyes, nose or mouth. From there, the virus can enter your body and can make you sick. Make sure you, and the people around you, follow good respiratory hygiene. This means covering your mouth and nose with your bent elbow or tissue when you cough or sneeze. Then dispose of the used tissue immediately. Why? Droplets spread virus. By following good respiratory hygiene, you protect the people around you from viruses such as cold, flu and COVID-19. Stay home if you feel unwell. If you have a fever, cough and difficulty breathing, seek medical attention and call in advance. Follow the directions of your local health authority. Why? National and local authorities will have the most up to date information on the situation in your area. Calling in advance will allow your health care provider to quickly direct you to the right health facility. This will also protect you and help prevent spread of viruses and other infections. Keep up to date on the latest COVID-19 hotspots (cities or local areas where COVID-19 is spreading widely). If possible, avoid traveling to places – especially if you are an older person or have diabetes, heart or lung disease. Why? You have a higher chance of catching COVID-19 in one of these areas."
7
+ 6. I am well and asymptomatic. Should I use a mask?,"According to the WHO, for individuals without respiratory symptoms, a medical mask is not required, as no evidence is available on its usefulness to protect non-sick persons. However, masks might be worn in some countries according to local cultural habits. If masks are used, best practices should be followed on how to wear, remove, and dispose of them and on hand hygiene action after removal. For more information, visit the WHO guidance on use of masks in the community."
8
+ 7. How likely am I to catch COVID-19?,"The risk depends on where you are - and more specifically, whether there is a COVID-19 outbreak unfolding there. For most people in most locations the risk of catching COVID-19 is still low. However, there are now places around the world (cities or areas) where the disease is spreading. For people living in, or visiting, these areas the risk of catching COVID-19 is higher. Governments and health authorities are taking vigorous action every time a new case of COVID-19 is identified. Be sure to comply with any local restrictions on travel, movement or large gatherings. Cooperating with disease control efforts will reduce your risk of catching or spreading COVID-19. COVID-19 outbreaks can be contained and transmission stopped, as has been shown in China and some other countries. Unfortunately, new outbreaks can emerge rapidly. Its important to be aware of the situation where you are or intend to go. WHO publishes daily updates on the COVID-19 situation worldwide. You can see these at https://www.who.int/emergencies/diseases/novel-coronavirus- 2019/situation-reports/"
9
+ 8. Are pregnant women more susceptible to the COVID-19 virus and will it harm the fetus?,"We do not have information from published scientific reports about the susceptibility of pregnant women to COVID-19. Pregnant women experience immunologic and physiologic changes, which might make them more susceptible to viral respiratory infections, including COVID-19. The virus that causes COVID-19 is thought to spread mainly by close contact with an infected person through respiratory droplets. Whether a pregnant woman with COVID-19 can transmit the virus that causes COVID-19 to her fetus or neonate by other routes of vertical transmission (before, during, or after delivery) is still unknown."
10
+ 9. What is the risk of my child becoming sick with COVID-19?,"Based on available evidence, children do not appear to be at higher risk for COVID-19 than adults. While some children and infants have been sick with COVID-19, adults make up most of the known cases to date. You can learn more about who is most at risk for health problems if they have COVID-19 infection on CDCs current Risk Assessment page."
11
+ 10. Are the symptoms of COVID-19 different in children than in adults?,"No. The symptoms of COVID-19 are similar in children and adults. However, children with confirmed COVID-19 have generally presented with mild symptoms. Reported symptoms in children include cold-like symptoms, such as fever, runny nose, and cough. Vomiting and diarrhea have also been reported. Its not known yet whether some children may be at higher risk for severe illness, for example, children with underlying medical conditions and special healthcare needs. There is much more to be learned about how the disease impacts children."
app (7).py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import openai
3
+
4
+ os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
5
+ import csv
6
+ import json
7
+
8
+ # Define the CSV file input path
9
+ csv_file_path = "COVID19_FAQ - COVID19_FAQ.csv"
10
+
11
+ # Initialize an empty list to store the data
12
+ data = []
13
+
14
+ # Open the CSV file for reading
15
+ with open(csv_file_path, mode='r', newline='') as csv_file:
16
+ # Create a CSV reader object
17
+ csv_reader = csv.DictReader(csv_file)
18
+
19
+ # Iterate through the CSV data and append it to the list
20
+ for row in csv_reader:
21
+ data.append(row)
22
+
23
+ # Convert the list of dictionaries to a JSON string
24
+ json_file = json.dumps(data, indent=4)
25
+
26
+ def respond(message, chat_history):
27
+ global json_file
28
+ prompt = f"You are a conversational chatbot.Answer all questions ***{message}*** smoothly. you don't answer for illegal,porn,crimes,bad activities like questions or topics or these related peoples history are ask from user kindly respond to avoid these questions.you don't answer about porn peoples.You can answer only related to this json file ***{json_file}*** questions otherwise simply say 'i dont know'."
29
+ response = openai.Completion.create(
30
+ engine="text-davinci-003", # You can choose a different engine if needed
31
+ prompt=prompt,
32
+ max_tokens=500, # Adjust max_tokens as needed
33
+ temperature=0, # Adjust temperature as needed
34
+ )
35
+
36
+ # Extract and print the generated text
37
+ translated_text = response.choices[0].text.strip()
38
+ chat_history.append((message, translated_text))
39
+ return "", chat_history
40
+
41
+
42
+ with gr.Blocks() as demo:
43
+ chatbot = gr.Chatbot().style(height=350)
44
+ msg = gr.Textbox()
45
+ clear = gr.ClearButton([msg, chatbot])
46
+ msg.submit(respond, [msg, chatbot], [msg, chatbot])
47
+
48
+ demo.launch()
requirements (1).txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ openai==0.23.1
2
+ gradio==3.46.0