derek-thomas
commited on
Commit
·
061a52a
1
Parent(s):
f615065
Updating markdown
Browse files
app.py
CHANGED
|
@@ -24,13 +24,47 @@ def sentence_diagram(model_name, text, progress=gr.Progress(track_tqdm=True)):
|
|
| 24 |
|
| 25 |
|
| 26 |
with gr.Blocks() as demo:
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
model_name = gr.Dropdown(choices=model_choices, label='Model Name')
|
| 29 |
text_in = gr.Textbox(label='Sentence(s) to diagram', value='This is a test')
|
| 30 |
button = gr.Button('Run!')
|
| 31 |
html_out = gr.HTML()
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
button.click(sentence_diagram,
|
| 36 |
inputs=[model_name, text_in],
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
with gr.Blocks() as demo:
|
| 27 |
+
gr.Markdown("""
|
| 28 |
+
# Purpose
|
| 29 |
+
Way back in 7th grade, my english teacher "Brother Hill" would always disclaim our sentence diagram lessons with:
|
| 30 |
+
"you probably wont be doing these in 20 years". A few of us being middle schoolers would love to contradict this.
|
| 31 |
+
Unfortunately he passed away in 2015, so I thought this would be a nice tribute.
|
| 32 |
+
|
| 33 |
+
# Instructions
|
| 34 |
+
1. Choose a model, the `ptb.biaffine.dep.roberta` is slower but marginally better
|
| 35 |
+
2. Write your sentence
|
| 36 |
+
3. Click Run!
|
| 37 |
+
""")
|
| 38 |
+
with gr.Tab("Brother Hill Tribute: Sentence Diagrams"):
|
| 39 |
model_name = gr.Dropdown(choices=model_choices, label='Model Name')
|
| 40 |
text_in = gr.Textbox(label='Sentence(s) to diagram', value='This is a test')
|
| 41 |
button = gr.Button('Run!')
|
| 42 |
html_out = gr.HTML()
|
| 43 |
+
gr.Markdown("""
|
| 44 |
+
# Information
|
| 45 |
+
This doesnt look like the sentences we used to do!
|
| 46 |
+
|
| 47 |
+
There are some slight differences in both presentation and linquistic analysis as shown
|
| 48 |
+
[here](https://en.wikipedia.org/wiki/Sentence_diagram), but they are similar enough for me not to mind too much.
|
| 49 |
+
|
| 50 |
+
How did you do this?
|
| 51 |
+
|
| 52 |
+
I chose a state of the art **Dependency Parsing** [model](https://github.com/yzhangcs/parser) as of ~2 years ago.
|
| 53 |
+
I believe this has been [surpassed(]https://paperswithcode.com/sota/dependency-parsing-on-penn-treebank)
|
| 54 |
+
in recent years.
|
| 55 |
+
|
| 56 |
+
Dependency Parsing was a popular task in NLP to feed to models to improve performance, but in the age of the
|
| 57 |
+
[transformer](https://arxiv.org/abs/1706.03762) it's rarelu used in anymore.
|
| 58 |
+
|
| 59 |
+
# To Brother Hlll
|
| 60 |
+
Thanks for being a great teacher. As an adult I appreciate that you dont get to witness a lot of the fruits of your
|
| 61 |
+
investment in us as we were just middle schoolers, yet you invested nonetheless. I have a lot of fond memories of
|
| 62 |
+
you, and I wish we could have connected before you passed away.
|
| 63 |
+
|
| 64 |
+
Thanks again,
|
| 65 |
+
|
| 66 |
+
Derek
|
| 67 |
+
""")
|
| 68 |
|
| 69 |
button.click(sentence_diagram,
|
| 70 |
inputs=[model_name, text_in],
|