Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -113,12 +113,12 @@ def get_high_info_terms(text: str) -> list:
|
|
| 113 |
]
|
| 114 |
|
| 115 |
# Identify key phrases
|
| 116 |
-
preserved_phrases = []
|
| 117 |
-
lower_text = text.lower()
|
| 118 |
-
for phrase in key_phrases:
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
|
| 123 |
# Extract individual words
|
| 124 |
words = re.findall(r'\b\w+(?:-\w+)*\b', text)
|
|
@@ -130,7 +130,8 @@ def get_high_info_terms(text: str) -> list:
|
|
| 130 |
and any(c.isalpha() for c in word)
|
| 131 |
]
|
| 132 |
|
| 133 |
-
all_terms = preserved_phrases + high_info_words
|
|
|
|
| 134 |
seen = set()
|
| 135 |
unique_terms = []
|
| 136 |
for term in all_terms:
|
|
|
|
| 113 |
]
|
| 114 |
|
| 115 |
# Identify key phrases
|
| 116 |
+
#preserved_phrases = []
|
| 117 |
+
#lower_text = text.lower()
|
| 118 |
+
#for phrase in key_phrases:
|
| 119 |
+
# if phrase in lower_text:
|
| 120 |
+
# preserved_phrases.append(phrase)
|
| 121 |
+
# text = text.replace(phrase, '')
|
| 122 |
|
| 123 |
# Extract individual words
|
| 124 |
words = re.findall(r'\b\w+(?:-\w+)*\b', text)
|
|
|
|
| 130 |
and any(c.isalpha() for c in word)
|
| 131 |
]
|
| 132 |
|
| 133 |
+
#all_terms = preserved_phrases + high_info_words
|
| 134 |
+
all_terms = high_info_words
|
| 135 |
seen = set()
|
| 136 |
unique_terms = []
|
| 137 |
for term in all_terms:
|