Update app.py
Browse files
app.py
CHANGED
|
@@ -7,12 +7,12 @@ from sentencex import segment
|
|
| 7 |
|
| 8 |
model = SentenceTransformer("Corran/SciGenAllMiniLM")
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
-
rf =
|
| 13 |
rf_emb = model.encode(rf)
|
| 14 |
index = Index(ndim=rf_emb[0].size)
|
| 15 |
-
index.add(range(len(
|
| 16 |
|
| 17 |
def get_matches(input):
|
| 18 |
global index, model, rf
|
|
|
|
| 7 |
|
| 8 |
model = SentenceTransformer("Corran/SciGenAllMiniLM")
|
| 9 |
|
| 10 |
+
rf = load_dataset("Corran/RhetoricFunctionsList")['train']['rhetoric_function']
|
| 11 |
|
| 12 |
+
rf = list(rf)
|
| 13 |
rf_emb = model.encode(rf)
|
| 14 |
index = Index(ndim=rf_emb[0].size)
|
| 15 |
+
index.add(range(len(rf)), rf_emb)
|
| 16 |
|
| 17 |
def get_matches(input):
|
| 18 |
global index, model, rf
|