Spaces:
Sleeping
Sleeping
Initial Draft
Browse files
app.py
CHANGED
@@ -5,11 +5,71 @@ import streamlit as st
|
|
5 |
################################
|
6 |
|
7 |
def option_change():
|
8 |
-
st.session_state.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
def button_clicked():
|
11 |
st.session_state.output_text="Button Clicked"
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
################################
|
14 |
####### Display of data ########
|
15 |
################################
|
|
|
5 |
################################
|
6 |
|
7 |
def option_change():
|
8 |
+
if st.session_state.action_type=="Sentiment Analysis":
|
9 |
+
sentiment_analysis()
|
10 |
+
elif st.session_state.action_type=="Zero-shot Classification":
|
11 |
+
zero_shot_classification()
|
12 |
+
elif st.session_state.action_type=="Text Generation":
|
13 |
+
text_generation()
|
14 |
+
elif st.session_state.action_type=="Mask Filling":
|
15 |
+
mask_filling()
|
16 |
+
elif st.session_state.action_type=="Named Entity Recognition":
|
17 |
+
named_entity_recognition()
|
18 |
+
elif st.session_state.action_type=="Question & Answering":
|
19 |
+
qna()
|
20 |
+
elif st.session_state.action_type=="Summarization":
|
21 |
+
summarization()
|
22 |
+
elif st.session_state.action_type=="English to French Translation":
|
23 |
+
translation_eng2frn()
|
24 |
|
25 |
def button_clicked():
|
26 |
st.session_state.output_text="Button Clicked"
|
27 |
|
28 |
+
def sentiment_analysis():
|
29 |
+
st.session_state.input_text="I've been waiting for a HuggingFace course my whole life."
|
30 |
+
|
31 |
+
def zero_shot_classification():
|
32 |
+
st.session_state.input_text="This is a course about the transformers library"
|
33 |
+
|
34 |
+
def text_generation():
|
35 |
+
st.session_state.input_text="In this course, we will teach you how to"
|
36 |
+
|
37 |
+
def mask_filling():
|
38 |
+
st.session_state.input_text="This course will teach you all about <mask> models."
|
39 |
+
|
40 |
+
def named_entity_recognition():
|
41 |
+
st.session_state.input_text="My name is Sylvain and I work at Hugging Face in Brooklyn."
|
42 |
+
|
43 |
+
def qna():
|
44 |
+
st.session_state.input_text="My name is Sylvain and I work at Hugging Face in Brooklyn"
|
45 |
+
|
46 |
+
def summarization():
|
47 |
+
st.session_state.input_text=
|
48 |
+
"""
|
49 |
+
America has changed dramatically during recent years. Not only has the number of
|
50 |
+
graduates in traditional engineering disciplines such as mechanical, civil,
|
51 |
+
electrical, chemical, and aeronautical engineering declined, but in most of
|
52 |
+
the premier American universities engineering curricula now concentrate on
|
53 |
+
and encourage largely the study of engineering science. As a result, there
|
54 |
+
are declining offerings in engineering subjects dealing with infrastructure,
|
55 |
+
the environment, and related issues, and greater concentration on high
|
56 |
+
technology subjects, largely supporting increasingly complex scientific
|
57 |
+
developments. While the latter is important, it should not be at the expense
|
58 |
+
of more traditional engineering.
|
59 |
+
|
60 |
+
Rapidly developing economies such as China and India, as well as other
|
61 |
+
industrial countries in Europe and Asia, continue to encourage and advance
|
62 |
+
the teaching of engineering. Both China and India, respectively, graduate
|
63 |
+
six and eight times as many traditional engineers as does the United States.
|
64 |
+
Other industrial countries at minimum maintain their output, while America
|
65 |
+
suffers an increasingly serious decline in the number of engineering graduates
|
66 |
+
and a lack of well-educated engineers.
|
67 |
+
"""
|
68 |
+
|
69 |
+
def translation_eng2frn():
|
70 |
+
st.session_state.input_text= "This course is produced by Hugging Face."
|
71 |
+
|
72 |
+
|
73 |
################################
|
74 |
####### Display of data ########
|
75 |
################################
|