harshildarji commited on
Commit
2d3c2b4
1 Parent(s): 789d89c

update app

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -109,7 +109,7 @@ st.markdown(
109
  unsafe_allow_html=True,
110
  )
111
 
112
- # Initialization for Legal NER
113
  tokenizer_legal = AutoTokenizer.from_pretrained("PaDaS-Lab/gbert-legal-ner")
114
  model_legal = AutoModelForTokenClassification.from_pretrained(
115
  "PaDaS-Lab/gbert-legal-ner"
@@ -123,7 +123,7 @@ model_gdpr = AutoModelForTokenClassification.from_pretrained(
123
  )
124
  ner_gdpr = pipeline("ner", model=model_gdpr, tokenizer=tokenizer_gdpr)
125
 
126
- # Define class labels for Legal and GDPR NER models
127
  classes_legal = {
128
  "AN": "Lawyer",
129
  "EUN": "European legal norm",
@@ -220,11 +220,11 @@ st.markdown("<hr>", unsafe_allow_html=True)
220
 
221
  test_sentence = st.text_area("Enter Text:", height=150)
222
  model_choice = st.selectbox(
223
- "Choose a model:", ["Legal NER", "GDPR Privacy Policy NER"], index=0
224
  )
225
 
226
  if st.button("Analyze"):
227
- if model_choice == "Legal NER":
228
  ner_model = ner_legal
229
  current_classes = classes_legal
230
  current_ner_labels = ner_labels_legal
 
109
  unsafe_allow_html=True,
110
  )
111
 
112
+ # Initialization for German Legal NER
113
  tokenizer_legal = AutoTokenizer.from_pretrained("PaDaS-Lab/gbert-legal-ner")
114
  model_legal = AutoModelForTokenClassification.from_pretrained(
115
  "PaDaS-Lab/gbert-legal-ner"
 
123
  )
124
  ner_gdpr = pipeline("ner", model=model_gdpr, tokenizer=tokenizer_gdpr)
125
 
126
+ # Define class labels for German Legal and GDPR NER models
127
  classes_legal = {
128
  "AN": "Lawyer",
129
  "EUN": "European legal norm",
 
220
 
221
  test_sentence = st.text_area("Enter Text:", height=150)
222
  model_choice = st.selectbox(
223
+ "Choose a model:", ["German Legal NER", "GDPR Privacy Policy NER"], index=0
224
  )
225
 
226
  if st.button("Analyze"):
227
+ if model_choice == "German Legal NER":
228
  ner_model = ner_legal
229
  current_classes = classes_legal
230
  current_ner_labels = ner_labels_legal