pragnakalp commited on
Commit
b523034
1 Parent(s): 40adbf7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -13
app.py CHANGED
@@ -27,7 +27,7 @@ DATA_FILENAME = "bert_base_ner_logs.csv"
27
  DATA_FILE = os.path.join("bert_base_ner_logs", DATA_FILENAME)
28
  DATASET_REPO_ID = "pragnakalp/bert_base_ner"
29
  print("is none?", HF_TOKEN is None)
30
-
31
  try:
32
  hf_hub_download(
33
  repo_id=DATASET_REPO_ID,
@@ -129,16 +129,34 @@ def save_data_and_sendmail(article,output):
129
  except Exception as e:
130
  return "Error while sending mail" + str(e)
131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
 
133
- inputs=gr.Textbox(lines=5, label="Sentences",elem_id="inp_div")
134
- outputs = [gr.Dataframe(row_count = (2, "dynamic"), col_count=(2, "fixed"), label="Here is the Result", headers=["Entities Found","Entity Types"])]
135
-
136
- demo = gr.Interface(
137
- generate_emotion,
138
- inputs,
139
- outputs,
140
- title="Entity Recognition For Input Text",
141
- description="Feel free to give your feedback",
142
- css=".gradio-container {background-color: lightgray} #inp_div {background-color: [#7](https://www1.example.com/issues/7)FB3D5;"
143
- )
144
- demo.launch()
 
27
  DATA_FILE = os.path.join("bert_base_ner_logs", DATA_FILENAME)
28
  DATASET_REPO_ID = "pragnakalp/bert_base_ner"
29
  print("is none?", HF_TOKEN is None)
30
+ input_value = "The U.S. President Donald Trump came to visit Ahmedabad first time at Motera Stadium with our Prime Minister Narendra Modi in February 2020"
31
  try:
32
  hf_hub_download(
33
  repo_id=DATASET_REPO_ID,
 
129
  except Exception as e:
130
  return "Error while sending mail" + str(e)
131
 
132
+ with gr.Blocks(css = ".gradio-container {background-color: lightgray}") as demo:
133
+ gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>"
134
+ + "Named Entity Recognition Using BERT"
135
+ + "</h1>")
136
+ with gr.Row(): [Neon Coqui TTS Plugin](https://github.com/NeonGeckoCom/neon-tts-plugin-coqui)
137
+ with gr.Column():
138
+ input=gr.Textbox(lines=5, value=input_value, label="Input Text", elem_id="inp_div")
139
+ sub_btn = gr.Button("Submit")
140
+ output = [gr.Dataframe(row_count = (3, "dynamic"), col_count=(2, "fixed"), label="Here is the Result", headers=["Entities Found","Entity Types"])]
141
+ gr.Markdown(
142
+ """
143
+ Feel free to give us your <a href="https://www.pragnakalp.com/contact/"> feedback </a> on this NER demo.
144
+ For all your Named Entity Recognition related requirements, we are here to help you.<br />
145
+ Email us your requirement at <a href="mailto:[email protected]"> [email protected] </a> .
146
+ And don't forget to check out more interesting <a href="https://www.pragnakalp.com/services/natural-language-processing-services/">NLP services</a> we are offering.</ br>
147
+ <p style='text-align: center;><b>Developed by</b> : <a href="https://www.pragnakalp.com" target="_blank">Pragnakalp Techlabs </a>
148
+
149
+ """)
150
+
151
+ event = sub_btn.click(generate_emotion, inputs=input, outputs=output)
152
+ demo.launch()
153
 
154
+ # demo = gr.Interface(
155
+ # generate_emotion,
156
+ # inputs,
157
+ # outputs,
158
+ # title="Entity Recognition For Input Text",
159
+ # description="Feel free to give your feedback",
160
+ # css=".gradio-container {background-color: lightgray} #inp_div {background-color: [#7](https://www1.example.com/issues/7)FB3D5;"
161
+ # )
162
+ # demo.launch()