Spaces:
Runtime error
Runtime error
Jingxiang Mo commited on
Commit ·
064fc00
1
Parent(s): 9cf0047
Updates
Browse files- Preliminary Results.pdf +0 -0
- app.py +4 -6
Preliminary Results.pdf
CHANGED
|
Binary files a/Preliminary Results.pdf and b/Preliminary Results.pdf differ
|
|
|
app.py
CHANGED
|
@@ -6,11 +6,11 @@ from transformers import (
|
|
| 6 |
TokenClassificationPipeline,
|
| 7 |
AutoModelForTokenClassification,
|
| 8 |
AutoTokenizer,
|
|
|
|
|
|
|
| 9 |
)
|
| 10 |
-
import torch
|
| 11 |
from transformers.pipelines import AggregationStrategy
|
| 12 |
-
|
| 13 |
-
from transformers import BertTokenizer
|
| 14 |
|
| 15 |
# =====[ DEFINE PIPELINE ]===== #
|
| 16 |
class KeyphraseExtractionPipeline(TokenClassificationPipeline):
|
|
@@ -125,14 +125,12 @@ def answer_question(question):
|
|
| 125 |
return 'Answer: "' + answer + '"'
|
| 126 |
|
| 127 |
# =====[ DEFINE INTERFACE ]===== #'
|
| 128 |
-
title = "Azza
|
| 129 |
examples = [
|
| 130 |
["Where is the Eiffel Tower?"],
|
| 131 |
["What is the population of France?"]
|
| 132 |
]
|
| 133 |
|
| 134 |
-
|
| 135 |
-
|
| 136 |
demo = gr.Interface(
|
| 137 |
title = title,
|
| 138 |
|
|
|
|
| 6 |
TokenClassificationPipeline,
|
| 7 |
AutoModelForTokenClassification,
|
| 8 |
AutoTokenizer,
|
| 9 |
+
BertForQuestionAnswering,
|
| 10 |
+
BertTokenizer
|
| 11 |
)
|
|
|
|
| 12 |
from transformers.pipelines import AggregationStrategy
|
| 13 |
+
import torch
|
|
|
|
| 14 |
|
| 15 |
# =====[ DEFINE PIPELINE ]===== #
|
| 16 |
class KeyphraseExtractionPipeline(TokenClassificationPipeline):
|
|
|
|
| 125 |
return 'Answer: "' + answer + '"'
|
| 126 |
|
| 127 |
# =====[ DEFINE INTERFACE ]===== #'
|
| 128 |
+
title = "Azza Conversational Agent"
|
| 129 |
examples = [
|
| 130 |
["Where is the Eiffel Tower?"],
|
| 131 |
["What is the population of France?"]
|
| 132 |
]
|
| 133 |
|
|
|
|
|
|
|
| 134 |
demo = gr.Interface(
|
| 135 |
title = title,
|
| 136 |
|