Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] context_length does not work with NER #496

Open
psydok opened this issue Feb 22, 2025 · 0 comments
Open

[BUG] context_length does not work with NER #496

psydok opened this issue Feb 22, 2025 · 0 comments

Comments

@psydok
Copy link

psydok commented Feb 22, 2025

I'm trying to verify the context_length field works. CustomLLM is a fully inherited class from your OpenAI implementation, but without verification checking. I initialize the class and send a request - in the request I see full text of ~2000 characters. I thought a split should happen though.

config.cfg

[nlp]
lang = "en"
pipeline = ["llm"]

[components]

[components.llm]
factory = "llm"

[components.llm.task]
@llm_tasks = "spacy.NER.v3"
labels = ["PERSON", "LOCATION"]
description = Entities are names of people without title, names of streets, names of cities, names of countries, names of towns.
    Adjectives, verbs, adverbs are not entities.
    Pronouns are not entities.
alignment_mode = strict

[components.llm.task.label_definitions]
PERSON = "A named individual found in the text."
LOCATION = "A names of location."

[components.llm.task.examples]
@misc = "spacy.FewShotReader.v1"
path = "ner_examples.json"

[components.llm.model]
@llm_models = "CustomLLM"
name = "Qwen/Qwen2.5-7B-Instruct"
endpoint = "http://localhost:8000/v1/chat/completions"
config = {"temperature": 0, "seed": 42}
max_tries = 5
max_request_time = 300
interval = 30
context_length = 500

[components.llm.task.normalizer]
@misc = "spacy.LowercaseNormalizer.v1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant