Duplicate from awacke1/GradioVoicetoTexttoSentiment
Browse filesCo-authored-by: Aaron C Wacker <[email protected]>
- .gitattributes +34 -0
- AsynchronousRealTimeLiveAITelemedicineSystem.mp3 +0 -0
- README.md +14 -0
- app.py +73 -0
- requirements.txt +2 -0
.gitattributes
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
AsynchronousRealTimeLiveAITelemedicineSystem.mp3
ADDED
Binary file (434 kB). View file
|
|
README.md
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: GradioVoicetoTexttoSentiment
|
3 |
+
emoji: 🌍
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: red
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: 3.18.0
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
license: mit
|
11 |
+
duplicated_from: awacke1/GradioVoicetoTexttoSentiment
|
12 |
+
---
|
13 |
+
|
14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
|
5 |
+
classifier = pipeline("text-classification", "michellejieli/emotion_text_classifier")
|
6 |
+
|
7 |
+
def transcribe(speech, state=""):
|
8 |
+
text = asr(speech)["text"]
|
9 |
+
state += text + " "
|
10 |
+
return text, state
|
11 |
+
|
12 |
+
def speech_to_text(speech):
|
13 |
+
text = asr(speech)["text"]
|
14 |
+
return text
|
15 |
+
|
16 |
+
def text_to_sentiment(text):
|
17 |
+
return classifier(text)[0]["label"]
|
18 |
+
|
19 |
+
|
20 |
+
demo = gr.Blocks()
|
21 |
+
with demo:
|
22 |
+
|
23 |
+
microphone = gr.Audio(source="microphone", type="filepath")
|
24 |
+
audio_file = gr.Audio(type="filepath")
|
25 |
+
text = gr.Textbox()
|
26 |
+
label = gr.Label()
|
27 |
+
|
28 |
+
b0 = gr.Button("Speech From Microphone")
|
29 |
+
b1 = gr.Button("Recognize Speech")
|
30 |
+
b2 = gr.Button("Classify Sentiment")
|
31 |
+
|
32 |
+
#b0.click(transcribe, inputs=[microphone, "state"], outputs=[text, "state"], live=True)
|
33 |
+
b0.click(transcribe, inputs=[microphone], outputs=[text])
|
34 |
+
b1.click(speech_to_text, inputs=audio_file, outputs=text)
|
35 |
+
b2.click(text_to_sentiment, inputs=text, outputs=label)
|
36 |
+
|
37 |
+
gr.Markdown("""References:
|
38 |
+
|
39 |
+
## Building an Asynchronous Real-Time Live Telemedicine System Using AI Pipelines for Smart Communities
|
40 |
+
|
41 |
+
1. **Designing the Telemedicine System**
|
42 |
+
- Identify the needs and challenges of smart communities and design a telemedicine system that addresses these challenges.
|
43 |
+
- Choose a platform that allows for asynchronous real-time communication, such as video conferencing or chat-based messaging, to facilitate remote consultations with healthcare providers.
|
44 |
+
- Design the system to incorporate AI pipelines that can analyze patient data and provide decision support for healthcare providers.
|
45 |
+
|
46 |
+
2. **Implementing the AI Pipelines**
|
47 |
+
- Identify the relevant AI algorithms and techniques that can be used to analyze patient data, such as machine learning or natural language processing.
|
48 |
+
- Integrate these AI pipelines into the telemedicine system to provide decision support for healthcare providers during consultations.
|
49 |
+
- Ensure that the AI algorithms are accurate and reliable by testing them on a large and diverse set of patient data.
|
50 |
+
|
51 |
+
3. **Deploying the Telemedicine System**
|
52 |
+
- Deploy the telemedicine system in smart communities, ensuring that it is easily accessible and user-friendly for patients and healthcare providers.
|
53 |
+
- Train healthcare providers on how to use the system effectively and provide ongoing support and feedback to optimize its use.
|
54 |
+
- Continuously monitor and evaluate the system's performance, making improvements and updates as needed to ensure that it remains effective and efficient in meeting the needs of smart communities.
|
55 |
+
|
56 |
+
**__Asynchronous Telemedicine:__ A Solution to Address Provider Shortages by Offering Remote Care Services.**
|
57 |
+
([Wikipedia](https://en.wikipedia.org/wiki/Telemedicine))
|
58 |
+
|
59 |
+
|
60 |
+
# 2023's Top 7 Breakthroughs in Medical Technology
|
61 |
+
1. __Asynchronous Telemedicine:__ A Solution to Address Provider Shortages by Offering Remote Care Services. ([Wikipedia](https://en.wikipedia.org/wiki/Telemedicine))
|
62 |
+
2. __Ambient and Emotion AI:__ Empowering Patients with Artificial Intelligence That Shows Empathy and Compassion. ([Wikipedia](https://en.wikipedia.org/wiki/Ambient_intelligence))
|
63 |
+
3. __Skin Patch Technology:__ A Convenient Way to Measure Vital Signals such as Blood Pressure and Glucose Levels. ([Wikipedia](https://en.wikipedia.org/wiki/Skin_patch))
|
64 |
+
4. __Affordable Vein Scanner:__ A Revolutionary Tool to View Veins Through the Skin. ([Wikipedia](https://en.wikipedia.org/wiki/Vein_matching))
|
65 |
+
5. __Synthetic Medical Records:__ Creating Reliable Medical Records Using Generative Adversarial Networks. ([Wikipedia](https://en.wikipedia.org/wiki/Synthetic_data))
|
66 |
+
6. __Blood Draw Devices for Clinical Trials:__ Facilitating Remote Participation in Trials with Innovative Technology. ([Wikipedia](https://en.wikipedia.org/wiki/Blood_sampling))
|
67 |
+
7. __Smart TVs for Remote Care:__ Enhancing Remote Care Consultations with Video Chat and Recordings. ([Wikipedia](https://en.wikipedia.org/wiki/Smart_television))
|
68 |
+
|
69 |
+
Reference: [The Medical Futurist](https://www.youtube.com/watch?v=_9DpLD4S2AY&list=PLHgX2IExbFotoMt32SrT3Xynt5BXTGnEP&index=2)
|
70 |
+
|
71 |
+
""")
|
72 |
+
|
73 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
transformers
|
2 |
+
torch
|