Spaces:
Sleeping
Sleeping
add app
Browse files
app.py
CHANGED
@@ -64,26 +64,16 @@ if __name__ == '__main__':
|
|
64 |
"momo/KcBERT-base_Hate_speech_Privacy_Detection",
|
65 |
]
|
66 |
|
67 |
-
#
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
pipe = TextClassificationPipeline(
|
79 |
-
model = model,
|
80 |
-
tokenizer = tokenizer,
|
81 |
-
return_all_scores=True,
|
82 |
-
function_to_apply='sigmoid'
|
83 |
-
)
|
84 |
|
85 |
-
gr.Interface.from_pipeline(pipe).launch()
|
86 |
-
|
87 |
|
88 |
# # global var
|
89 |
# MODEL_NAME = 'jason9693/SoongsilBERT-base-beep'
|
|
|
64 |
"momo/KcBERT-base_Hate_speech_Privacy_Detection",
|
65 |
]
|
66 |
|
67 |
+
#Create a gradio app with a button that calls predict()
|
68 |
+
app = gr.Interface(
|
69 |
+
fn=predict,
|
70 |
+
inputs=[gr.inputs.Dropdown(model_name_list, label="Model Name"), 'text'], outputs=['label'],
|
71 |
+
examples = [[MODEL_BUF["name"], text], [MODEL_BUF["name"], "4=๐ฆ 4โ ๐ฆ"]],
|
72 |
+
title="ํ๊ตญ์ด ํ์คํํ, ๊ฐ์ธ์ ๋ณด ํ๋ณ๊ธฐ (Korean Hate Speech and Privacy Detection)",
|
73 |
+
description="Korean Hate Speech and Privacy Detection."
|
74 |
+
)
|
75 |
+
app.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
|
|
|
|
|
77 |
|
78 |
# # global var
|
79 |
# MODEL_NAME = 'jason9693/SoongsilBERT-base-beep'
|