Spaces:
Sleeping
Sleeping
fixed
Browse files
app.py
CHANGED
@@ -5,6 +5,11 @@ import numpy as np
|
|
5 |
# Initialize the pipeline
|
6 |
pipe = pipeline("text-classification", model="AbrorBalxiyev/text-classification", return_all_scores=True)
|
7 |
|
|
|
|
|
|
|
|
|
|
|
8 |
def get_html_for_results(results):
|
9 |
# Sort results by score in descending order
|
10 |
sorted_results = sorted(results, key=lambda x: x['score'], reverse=True)
|
|
|
5 |
# Initialize the pipeline
|
6 |
pipe = pipeline("text-classification", model="AbrorBalxiyev/text-classification", return_all_scores=True)
|
7 |
|
8 |
+
label_mapping = {
|
9 |
+
0: 'Avto', 1: 'Biznes', 2: 'Iqtisodiyot', 3: 'Kino', 4: 'Kitob',
|
10 |
+
5: 'Koinot', 6: 'Madaniyat', 7: 'Ob-havo', 8: 'Sayohat', 9: 'Sport', 10: 'Texnologiya'
|
11 |
+
}
|
12 |
+
|
13 |
def get_html_for_results(results):
|
14 |
# Sort results by score in descending order
|
15 |
sorted_results = sorted(results, key=lambda x: x['score'], reverse=True)
|