Spaces:
Sleeping
Sleeping
File size: 2,046 Bytes
f698425 284f0bc f698425 0574def 13f1d60 0a18ebf eae86ce 0a18ebf fe70d6b 77f9ccc fe70d6b 0574def fe70d6b 0d5fb2d d7c5584 0d5fb2d 7810758 47f35c0 0d5fb2d f698425 0574def b4291f5 13f1d60 0574def 0d5fb2d 0574def 0a18ebf b4291f5 f698425 13f1d60 7de657a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | import gradio as gr
import re
from transformers import pipeline
# โหลดโมเดลจาก Hugging Face Hub
ner_pipeline = pipeline(
task="ner",
model="Nucha/Nucha_ITSkillNER_BERT",
aggregation_strategy="simple"
)
examples = [
"Responsibilities Develop and maintain web applications using C#.NET, ReactJS , and PHP frameworks . Collaborate with the team and clients to gather and analyze business needs. Implement solutions and integrate automated testing within the development process using CICD tools . Contribute to the design and development of largescale applications . Provide and receive constructive feedback on projects. Qualifications Bachelors degree in Computer Science , Software Engineering , or a related field preferred but not required. Minimum of 1+ years of experience in C#.NET and ReactJS , or a strong willingness to learn. Experience using JIRA for project management. Skilled in writing API documentation using Paw . Experience working with RESTful web services . knowledge of AWS is an advantage."
]
def preprocess_text(text):
return text.replace(",", " ")
# ฟังก์ชันประมวลผลข้อความ
def extract_skills(text):
text=preprocess_text(text)
entities = ner_pipeline(text)
for result in entities:
if result.get("entity_group"):
result["entity"] = result["entity_group"]
del result["entity_group"]
print(entities)
return {"text": text, "entities": entities}
# UI ของ Gradio
demo = gr.Interface(
fn=extract_skills,
inputs=gr.Textbox(lines=5, placeholder="พิมพ์ข้อความเกี่ยวกับ IT job description ที่นี่..."),
outputs=["highlight"],
title="IT Skill NER Extractor",
description="โมเดลสำหรับแยกทักษะด้านไอทีจากข้อความประกาศงาน",
examples=examples
)
if __name__ == "__main__":
demo.launch()
|