Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import pandas as pd
|
2 |
import re
|
3 |
-
import json
|
4 |
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
|
5 |
import gradio as gr
|
6 |
|
@@ -184,27 +183,27 @@ def process_text(input_text):
|
|
184 |
# محاسبه و نمایش میانگین نمرات
|
185 |
average_score = (job_score + education_score + skill_score + loc_score + age_score) / 5
|
186 |
|
187 |
-
# ساخت خروجی
|
188 |
-
output =
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
return
|
204 |
|
205 |
iface = gr.Interface(
|
206 |
fn=process_text,
|
207 |
-
inputs=gr.Textbox(lines=10, placeholder="لطفاً متن خود را وارد کنید..."),
|
208 |
outputs="text",
|
209 |
title="متن پرداز",
|
210 |
description="این ابزار متن شما را پردازش کرده و امتیازات مشابهت را محاسبه میکند."
|
|
|
1 |
import pandas as pd
|
2 |
import re
|
|
|
3 |
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
|
4 |
import gradio as gr
|
5 |
|
|
|
183 |
# محاسبه و نمایش میانگین نمرات
|
184 |
average_score = (job_score + education_score + skill_score + loc_score + age_score) / 5
|
185 |
|
186 |
+
# ساخت خروجی به صورت متن
|
187 |
+
output = f"""
|
188 |
+
average_score: {average_score}
|
189 |
+
full_name: {full_name}
|
190 |
+
age: {age}
|
191 |
+
location: {loc}
|
192 |
+
job_score: {job_score}
|
193 |
+
education_score: {education_score}
|
194 |
+
skill_score: {skill_score}
|
195 |
+
loc_score: {loc_score}
|
196 |
+
age_score: {age_score}
|
197 |
+
common_jobs: {list(common_jobs)}
|
198 |
+
common_education: {list(common_education)}
|
199 |
+
common_skills: {list(common_skills)}
|
200 |
+
"""
|
201 |
+
|
202 |
+
return output
|
203 |
|
204 |
iface = gr.Interface(
|
205 |
fn=process_text,
|
206 |
+
inputs=gr.inputs.Textbox(lines=10, placeholder="لطفاً متن خود را وارد کنید..."),
|
207 |
outputs="text",
|
208 |
title="متن پرداز",
|
209 |
description="این ابزار متن شما را پردازش کرده و امتیازات مشابهت را محاسبه میکند."
|