Spaces:
Runtime error
Runtime error
quyip
commited on
Commit
·
2a78aa3
1
Parent(s):
aea3063
fix
Browse files- summary.py +2 -1
- utils/tag_utils.py +1 -3
summary.py
CHANGED
@@ -21,7 +21,8 @@ def summarize(text: str):
|
|
21 |
translated = get_en_translation(summary)
|
22 |
tags1 = get_classification(translated)
|
23 |
tags2 = get_tags(translated)
|
24 |
-
tags = filter_tags(
|
|
|
25 |
|
26 |
return {
|
27 |
"ver": AiSummaryVersion,
|
|
|
21 |
translated = get_en_translation(summary)
|
22 |
tags1 = get_classification(translated)
|
23 |
tags2 = get_tags(translated)
|
24 |
+
tags = filter_tags(tags1 + tags2)
|
25 |
+
tags = sorted(list(set(tags)))
|
26 |
|
27 |
return {
|
28 |
"ver": AiSummaryVersion,
|
utils/tag_utils.py
CHANGED
@@ -6,9 +6,7 @@ BlockTagContents = ['voice']
|
|
6 |
|
7 |
def filter_tags(tags: List[str]) -> List[str]:
|
8 |
tags = [tag.strip().lower().replace('|', '') for tag in tags]
|
9 |
-
|
10 |
if len(tag) > 2
|
11 |
and tag not in BlockTagNames
|
12 |
and not any(content in tag for content in BlockTagContents)]
|
13 |
-
return sorted(tags)
|
14 |
-
|
|
|
6 |
|
7 |
def filter_tags(tags: List[str]) -> List[str]:
|
8 |
tags = [tag.strip().lower().replace('|', '') for tag in tags]
|
9 |
+
return [tag for tag in tags
|
10 |
if len(tag) > 2
|
11 |
and tag not in BlockTagNames
|
12 |
and not any(content in tag for content in BlockTagContents)]
|
|
|
|