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()