Valeriy Sinyukov
commited on
Commit
·
3c2e6b2
1
Parent(s):
87e1cd4
test metrics for english
Browse files- app.py +15 -0
- category_classification/test_results.json +20 -0
app.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import pandas as pd
|
| 2 |
import streamlit as st
|
| 3 |
|
|
@@ -10,6 +13,12 @@ model_label = {en: "Select model", ru: "Выберете модель"}
|
|
| 10 |
title_label = {en: "Title", ru: "Название статьи"}
|
| 11 |
authors_label = {en: "Author(s)", ru: "Автор(ы)"}
|
| 12 |
abstract_label = {en: "Abstract", ru: "Аннотация"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
def text_area_height(line_height: int):
|
|
@@ -21,6 +30,7 @@ def load_class_model(name):
|
|
| 21 |
model = class_models.get_model(name)
|
| 22 |
return model
|
| 23 |
|
|
|
|
| 24 |
lang = st.pills(label=langs_str, options=langs)
|
| 25 |
if lang is None:
|
| 26 |
lang = en
|
|
@@ -38,3 +48,8 @@ if title:
|
|
| 38 |
results = model(input)
|
| 39 |
results = process_results(results, lang)
|
| 40 |
st.dataframe(results, hide_index=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
import pandas as pd
|
| 5 |
import streamlit as st
|
| 6 |
|
|
|
|
| 13 |
title_label = {en: "Title", ru: "Название статьи"}
|
| 14 |
authors_label = {en: "Author(s)", ru: "Автор(ы)"}
|
| 15 |
abstract_label = {en: "Abstract", ru: "Аннотация"}
|
| 16 |
+
metrics_label = {en: "Test metrics", ru: "Метрики на тренировочном датасете"}
|
| 17 |
+
|
| 18 |
+
with open(
|
| 19 |
+
Path(__file__).parent / "category_classification" / "test_results.json", "r"
|
| 20 |
+
) as metric_f:
|
| 21 |
+
metrics = json.load(metric_f)
|
| 22 |
|
| 23 |
|
| 24 |
def text_area_height(line_height: int):
|
|
|
|
| 30 |
model = class_models.get_model(name)
|
| 31 |
return model
|
| 32 |
|
| 33 |
+
|
| 34 |
lang = st.pills(label=langs_str, options=langs)
|
| 35 |
if lang is None:
|
| 36 |
lang = en
|
|
|
|
| 48 |
results = model(input)
|
| 49 |
results = process_results(results, lang)
|
| 50 |
st.dataframe(results, hide_index=True)
|
| 51 |
+
|
| 52 |
+
lang_metrics = pd.DataFrame(metrics[lang])
|
| 53 |
+
if not lang_metrics.empty:
|
| 54 |
+
with st.expander(metrics_label[lang]):
|
| 55 |
+
st.dataframe(lang_metrics)
|
category_classification/test_results.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"en": {
|
| 3 |
+
"Accuracy": {
|
| 4 |
+
"HibiscusMaximus.scibert_paper_classification": 0.8396666666666667,
|
| 5 |
+
"oracat.bert-paper-classifier-arxiv": 0.21833333333333332
|
| 6 |
+
},
|
| 7 |
+
"Macro F1": {
|
| 8 |
+
"HibiscusMaximus.scibert_paper_classification": 0.5253199699435153,
|
| 9 |
+
"oracat.bert-paper-classifier-arxiv": 0.06976813826285358
|
| 10 |
+
},
|
| 11 |
+
"Cross-entropy loss": {
|
| 12 |
+
"HibiscusMaximus.scibert_paper_classification": 356.9575782795263,
|
| 13 |
+
"oracat.bert-paper-classifier-arxiv": 726.6457145760214
|
| 14 |
+
}
|
| 15 |
+
},
|
| 16 |
+
"ru": {
|
| 17 |
+
"F1": {},
|
| 18 |
+
"Macro F1": {}
|
| 19 |
+
}
|
| 20 |
+
}
|