Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ def calculate_change_percentage(old_text, new_text):
|
|
| 31 |
return (1 - seqm.ratio()) * 100
|
| 32 |
|
| 33 |
def semantic_match(lo_texts, content):
|
| 34 |
-
vectorizer =
|
| 35 |
return cosine_similarity(vectorizer[0:1], vectorizer[1:]).flatten()
|
| 36 |
|
| 37 |
def generate_summary(change_pct, matched_los, total_los):
|
|
@@ -91,4 +91,4 @@ demo = gr.Interface(
|
|
| 91 |
description="Upload 2 handouts and a .docx file of Learning Outcomes to compare changes and alignment."
|
| 92 |
)
|
| 93 |
|
| 94 |
-
demo.launch(
|
|
|
|
| 31 |
return (1 - seqm.ratio()) * 100
|
| 32 |
|
| 33 |
def semantic_match(lo_texts, content):
|
| 34 |
+
vectorizer = TfidfVectorizer().fit_transform([content] + lo_texts)
|
| 35 |
return cosine_similarity(vectorizer[0:1], vectorizer[1:]).flatten()
|
| 36 |
|
| 37 |
def generate_summary(change_pct, matched_los, total_los):
|
|
|
|
| 91 |
description="Upload 2 handouts and a .docx file of Learning Outcomes to compare changes and alignment."
|
| 92 |
)
|
| 93 |
|
| 94 |
+
demo.launch()
|