Text Generation
Transformers
Safetensors
Korean
English
Japanese
qwen3
conversational
text-generation-inference
Instructions to use jaeyong2/Dynamic_NER with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jaeyong2/Dynamic_NER with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jaeyong2/Dynamic_NER") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jaeyong2/Dynamic_NER") model = AutoModelForCausalLM.from_pretrained("jaeyong2/Dynamic_NER", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jaeyong2/Dynamic_NER with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jaeyong2/Dynamic_NER" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jaeyong2/Dynamic_NER", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jaeyong2/Dynamic_NER
- SGLang
How to use jaeyong2/Dynamic_NER with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jaeyong2/Dynamic_NER" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jaeyong2/Dynamic_NER", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "jaeyong2/Dynamic_NER" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jaeyong2/Dynamic_NER", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jaeyong2/Dynamic_NER with Docker Model Runner:
docker model run hf.co/jaeyong2/Dynamic_NER
Update README.md
Browse files7 unmodified lines891011121343 unmodified lines5758596061626348 unmodified lines1121131141157 unmodified linesbase_model:- Qwen/Qwen3-0.6B---### example(En)```43 unmodified lines[{'text': 'Tim', 'type': 'PERSON'}, {'text': 'mom', 'type': 'PERSON'}, {'text': 'Sue', 'type': 'PERSON'}, {'text': 'park', 'type': 'LOCATION'}, {'text': 'fountain', 'type': 'LOCATION'}, {'text': 'fish', 'type': 'ANIMAL'}]</entities>```### examlpe (ko)```system = """48 unmodified lines<entities>[{'text': '์์ง์ด', 'type': 'PERSON'}, {'text': '์คํํ๋ ํ๋จ', 'type': 'LOCATION'}, {'text': '์์ดํฐ 16', 'type': 'PRODUCT'}, {'text': '๋ฐฉํ์๋ ๋จ', 'type': 'ORGANIZATION'}, {'text': '์ฝ์ํธ ์คํฉ ์ํ', 'type': 'WORK_OF_ART'}, {'text': 'ํ ์์ผ', 'type': 'DATE'}, {'text': '์นดํ ๋ ธํฐ๋', 'type': 'LOCATION'}]</entities>```7 unmodified lines891011121314151617181920212243 unmodified lines6667686970717248 unmodified lines1211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801817 unmodified linesbase_model:- Qwen/Qwen3-0.6B---## Model Detail### Goal- Perform dynamic NER: given a sentence and a runtime schema of entity types, extract all matching entities.- Support multilingual input (English, Korean, Japanese, etc.).### Limitation- The model tends to extract only one entity per type and may miss multiple mentions of the same type.- Overlapping or nested entities (e.g., โNew Yorkโ vs โYorkโ) may be unclear without explicit overlap policy.### example(En)```43 unmodified lines[{'text': 'Tim', 'type': 'PERSON'}, {'text': 'mom', 'type': 'PERSON'}, {'text': 'Sue', 'type': 'PERSON'}, {'text': 'park', 'type': 'LOCATION'}, {'text': 'fountain', 'type': 'LOCATION'}, {'text': 'fish', 'type': 'ANIMAL'}]</entities>```----------### examlpe (ko)```system = """48 unmodified lines<entities>[{'text': '์์ง์ด', 'type': 'PERSON'}, {'text': '์คํํ๋ ํ๋จ', 'type': 'LOCATION'}, {'text': '์์ดํฐ 16', 'type': 'PRODUCT'}, {'text': '๋ฐฉํ์๋ ๋จ', 'type': 'ORGANIZATION'}, {'text': '์ฝ์ํธ ์คํฉ ์ํ', 'type': 'WORK_OF_ART'}, {'text': 'ํ ์์ผ', 'type': 'DATE'}, {'text': '์นดํ ๋ ธํฐ๋', 'type': 'LOCATION'}]</entities>```-------### examlpe (ja)```system = """You are an AI that dynamically performs Named Entity Recognition (NER).You receive a sentence and a list of entity types the user wants to extract, and then identify all entities of those types within the sentence.If you cannot find any suitable entities within the sentence, return an empty list."""text = """ใชใใฏ4ๆใฎ็ตใใใซๆฑไบฌใใฃใบใใผใฉใณใใธ่กใใพใใใๅฝผๅฅณใฏในใใคใใกใใชใผใฎใทใงใผใ่ฆใฆใในใฟใผใใใฏในใงๆน่ถใฉใใ้ฃฒใฟใพใใใๅคใซใฏใๅใจๅๅฐใฎ็ฅ้ ใใใฎ็นๅฅไธๆ ไผใซใๅๅ ใใพใใใ""".strip()named_entity = """[{"type": "PERSON", "description": "ๅไบบๅ"},{"type": "LOCATION", "description": "ๅฐๅใๆฝ่จญๅ"},{"type": "ORGANIZATION", "description": "ไผ็คพใๅฃไฝๅ"},{"type": "WORK_OF_ART", "description": "ๆ ็ปใ้ณๆฅฝใใขใใกใๆธ็ฑใชใฉ"},{"type": "PRODUCT", "description": "ๅๅใใใฉใณใๅ"},{"type": "DATE", "description": "ๆฅไปใๆๆ"}]""".strip()user = f"<sentence>\n{text}\n</sentence>\n\n<entity_list>\n{named_entity}\n</entity_list>\n\n"chat = [{"role":"system", "content":system}, {"role":"user", "content":user}]chat_text = tokenizer.apply_chat_template(chat,enable_thinking=False,add_generation_prompt=True,tokenize=False)model_inputs = tokenizer([chat_text], return_tensors="pt").to(model.device)generated_ids = model.generate(**model_inputs,max_new_tokens=512)generated_ids = [output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)]response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]```### result (ja)```<entities>[{'text': 'ใชใ', 'type': 'PERSON'}, {'text': 'ๆฑไบฌ', 'type': 'LOCATION'}, {'text': 'ในใใคใใกใใชใผ', 'type': 'ORGANIZATION'}, {'text': 'ในใฟใผใใใฏใน', 'type': 'ORGANIZATION'}, {'text': 'ๅใจๅๅฐใฎ็ฅ้ ใ', 'type': 'WORK_OF_ART'}, {'text': 'ๅ่ถใฉใ', 'type': 'PRODUCT'}, {'text': '4ๆ', 'type': 'DATE'}]</entities>```
README.md+67-1