Spaces:
Runtime error
Runtime error
Rachel Rakov
commited on
Commit
·
681eeb9
1
Parent(s):
dd1a64f
Added README, updated instructions
Browse files- README.md +33 -0
- eng_to_aslGloss_app.py +5 -7
README.md
CHANGED
@@ -9,4 +9,37 @@ app_file: eng_to_aslGloss_app.py
|
|
9 |
pinned: false
|
10 |
---
|
11 |
# How to use English to ASL Gloss
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
9 |
pinned: false
|
10 |
---
|
11 |
# How to use English to ASL Gloss
|
12 |
+
|
13 |
+
### Introduction
|
14 |
+
|
15 |
+
This is a program that uses GPT4 to translate English text to ASL gloss.
|
16 |
+
This program makes use of prompt engineering to first describe the task it wants GPT4 to complete (along with examples of translations of English text and it's ASL gloss translations), and then providing GPT4 with the English text to translate to ASL_gloss.
|
17 |
+
|
18 |
+
These prompts are included as part of the package.
|
19 |
+
|
20 |
+
### Requirements
|
21 |
+
|
22 |
+
This program makes use of the following packages:
|
23 |
+
- Python 10 environment (required for tiktoken and openAI)
|
24 |
+
- openAI
|
25 |
+
- tiktoken
|
26 |
+
- openAI key and access to GPT4
|
27 |
+
|
28 |
+
### Limitations
|
29 |
+
|
30 |
+
- Token length
|
31 |
+
- GPT4 has a token limit, and our prompting uses a lot of the allocated tokens. As a result, your text must be shorter than 553 tokens. If your text is longer than that, program will not translate your text. (The program will calculate tokens for you, so you don't need to worry about doing that conversion)
|
32 |
+
- If/when this limit changes, we will update the program to better handle longer texts
|
33 |
+
|
34 |
+
- Speed and Cost
|
35 |
+
- Be aware that each time we run this code, it re-prompts GPT4 (since we can't save our models). As a result, it takes a little time and it costs a little bit of money. But it's not too bad.
|
36 |
+
|
37 |
+
- Imperfect ASL gloss
|
38 |
+
- Although this does a pretty good job, it's not perfect ASL gloss
|
39 |
+
- Some things you should watch for include:
|
40 |
+
- word order
|
41 |
+
- fingerspelling
|
42 |
+
- formatting rules <>
|
43 |
+
- As we continue to improve the prompting, we will update with any new prompts that we create that improve the ASL gloss output.
|
44 |
+
|
45 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
eng_to_aslGloss_app.py
CHANGED
@@ -93,12 +93,10 @@ def main():
|
|
93 |
|
94 |
title = "English to ASL Gloss"
|
95 |
#description = """Translate English text to ASL Gloss"""
|
96 |
-
description = "This program uses GPT4
|
97 |
-
|
98 |
-
the
|
99 |
-
|
100 |
-
GPT4 with the English text to translate to ASL_gloss. Using these prompts,\
|
101 |
-
GPT4 translates the input text into ASL gloss."
|
102 |
|
103 |
interface = gr.Interface(
|
104 |
fn=getGlossFromText,
|
@@ -106,7 +104,7 @@ def main():
|
|
106 |
outputs="text",
|
107 |
title = title,
|
108 |
description = description,
|
109 |
-
examples = [[("Every year I buy my dad a gift", "EVERY-YEAR<Ti>, MY DAD GIFT<T>, ME BUY<A>")]])
|
110 |
# examples=[["Every year I buy my dad a gift"], ["I always look forward to the family vacation"],
|
111 |
# ["If I don't travel often, I am sad."]])
|
112 |
interface.launch()
|
|
|
93 |
|
94 |
title = "English to ASL Gloss"
|
95 |
#description = """Translate English text to ASL Gloss"""
|
96 |
+
description = "This program uses GPT4 alongside prompt engineering to \
|
97 |
+
translate English text to ASL gloss.\n \
|
98 |
+
Type in the English sentence you would like to translate into ASL Gloss. \
|
99 |
+
\n For additional details on how the program works, please see the README.md"
|
|
|
|
|
100 |
|
101 |
interface = gr.Interface(
|
102 |
fn=getGlossFromText,
|
|
|
104 |
outputs="text",
|
105 |
title = title,
|
106 |
description = description,
|
107 |
+
examples = [[("Every year I buy my dad a gift", " EVERY-YEAR<Ti>, MY DAD GIFT<T>, ME BUY<A>")]])
|
108 |
# examples=[["Every year I buy my dad a gift"], ["I always look forward to the family vacation"],
|
109 |
# ["If I don't travel often, I am sad."]])
|
110 |
interface.launch()
|