Prompt like:

Extract the company names from the texts below and return as an array

– [“Google”, “Meta”, “Microsoft”]

  • DreamGenXB
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    On top of what other said, make sure to include a few shot examples in your prompt, and consider using constrained decoding (ensuring you get valid json of whatever schema you provide, see pointers on how to do it with llama.cpp).

    For few shotting chat models, append fake previous turns, like:

    System: 
    User: 
    Assistant: 
    ...
    User: 
    Assistant: 
    User: 
    
  • BrainSlugs83B
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    Why do you need an LLM for this? Just use any NER model. It will be blazing fast and run locally.

  • swagonflyyyyB
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    Huggingface transformers has such models available.