Universe

Concise Concepts

Concise Concepts uses few-shot NER based on word embedding similarity to get you going with easy!

spaCy v3

When wanting to apply NER to concise concepts, it is really easy to come up with examples, but it takes some effort to train an entire pipeline. Concise Concepts uses few-shot NER based on word embedding similarity to get you going with easy!

Example

import spacy from spacy import displacy import concise_concepts data = { "fruit": ["apple", "pear", "orange"], "vegetable": ["broccoli", "spinach", "tomato"], "meat": ["beef", "pork", "fish", "lamb"] } text = """ Heat the oil in a large pan and add the Onion, celery and carrots. Then, cook over a medium–low heat for 10 minutes, or until softened. Add the courgette, garlic, red peppers and oregano and cook for 2–3 minutes. Later, add some oranges and chickens.""" # use any model that has internal spacy embeddings nlp = spacy.load('en_core_web_lg') nlp.add_pipe("concise_concepts", config={"data": data} ) doc = nlp(text) options = {"colors": {"fruit": "darkorange", "vegetable": "limegreen", "meat": "salmon"}, "ents": ["fruit", "vegetable", "meat"]} displacy.render(doc, style="ent", options=options)

Author info

David Berenstein

GitHubpandora-intelligence/concise-concepts

Categories pipeline

Found a mistake or something isn't working?

If you've come across a universe project that isn't working or is incompatible with the reported spaCy version, let us know by opening a discussion thread.


Submit your project

If you have a project that you want the spaCy community to make use of, you can suggest it by submitting a pull request to the spaCy website repository. The Universe database is open-source and collected in a simple JSON file. For more details on the formats and available fields, see the documentation. Looking for inspiration your own spaCy plugin or extension? Check out the project idea label on the issue tracker.

Read the docsJSON source