Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,9 +8,9 @@ from semviqa.tvc.tvc_eval import classify_claim
|
|
8 |
|
9 |
# Load models with caching
|
10 |
@st.cache_resource()
|
11 |
-
def load_model(model_name, model_class):
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
13 |
-
model = model_class.from_pretrained(model_name)
|
14 |
return tokenizer, model
|
15 |
|
16 |
# UI Configuration
|
@@ -26,7 +26,7 @@ st.markdown("""
|
|
26 |
</style>
|
27 |
""", unsafe_allow_html=True)
|
28 |
|
29 |
-
st.markdown("<p class='big-title'>π SemViQA: Vietnamese Fact-Checking
|
30 |
st.markdown("<p class='sub-title'>Enter a claim and context to verify its accuracy</p>", unsafe_allow_html=True)
|
31 |
|
32 |
# Sidebar - Configuration Settings
|
@@ -39,7 +39,7 @@ with st.sidebar.expander("βοΈ Settings", expanded=False):
|
|
39 |
|
40 |
# Load selected models
|
41 |
tokenizer_qatc, model_qatc = load_model(qatc_model_name, QATCForQuestionAnswering)
|
42 |
-
tokenizer_bc, model_bc = load_model(bc_model_name, ClaimModelForClassification)
|
43 |
tokenizer_tc, model_tc = load_model(tc_model_name, ClaimModelForClassification)
|
44 |
|
45 |
# User Input Fields
|
|
|
8 |
|
9 |
# Load models with caching
|
10 |
@st.cache_resource()
|
11 |
+
def load_model(model_name, model_class, is_bc=False):
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
13 |
+
model = model_class.from_pretrained(model_name, num_labels=3 if not is_bc else 2)
|
14 |
return tokenizer, model
|
15 |
|
16 |
# UI Configuration
|
|
|
26 |
</style>
|
27 |
""", unsafe_allow_html=True)
|
28 |
|
29 |
+
st.markdown("<p class='big-title'>π SemViQA: A Semantic Question Answering System for Vietnamese Information Fact-Checking</p>", unsafe_allow_html=True)
|
30 |
st.markdown("<p class='sub-title'>Enter a claim and context to verify its accuracy</p>", unsafe_allow_html=True)
|
31 |
|
32 |
# Sidebar - Configuration Settings
|
|
|
39 |
|
40 |
# Load selected models
|
41 |
tokenizer_qatc, model_qatc = load_model(qatc_model_name, QATCForQuestionAnswering)
|
42 |
+
tokenizer_bc, model_bc = load_model(bc_model_name, ClaimModelForClassification, is_bc=True)
|
43 |
tokenizer_tc, model_tc = load_model(tc_model_name, ClaimModelForClassification)
|
44 |
|
45 |
# User Input Fields
|