Metadata-Version: 2.1
Name: concise-concepts
Version: 0.1.0
Summary: This repository contains an easy and intuitive approach to zero-shot and few-shot NER using internal spaCy embeddings.
Home-page: https://github.com/pandora-intelligence/concise-concepts
License: MIT
Keywords: spacy,NER,few-shot classification,nlu
Author: David Berenstein
Author-email: david.m.berenstein@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Requires-Dist: gensim (>=4,<5)
Requires-Dist: spacy (>=3,<4)
Project-URL: Documentation, https://github.com/pandora-intelligence/concise-concepts
Project-URL: Repository, https://github.com/pandora-intelligence/concise-concepts
Description-Content-Type: text/markdown

# Concise Concepts
When wanting to apply NER to concise concepts, it is really easy to come up with examples, but pretty difficult to train an entire pipeline. Concise Concepts uses word similarity based on few-shots to get you going with easy!

# Install
``` pip install classy-classification```

# Quickstart
```
import spacy
import concise_concepts

data = {
    "fruit": ["apple", "pear", "orange"],
    "vegetable": ["broccoli", "spinach", "tomato"],
    "meat": ["chicken", "beef", "pork", "fish", "lamb"]
}

text = """
    Heat the oil in a large pan and add the Onion, celery and carrots. 
    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. """

nlp = spacy.load('en_core_web_lg')
nlp.add_pipe("concise_concepts", config={"data": data})
doc = nlp(text)

print([(ent.text, ent.label_) for ent in doc.ents])
# Output:
#
# [('Onion', 'VEGETABLE'), ('Celery', 'VEGETABLE'), ('carrots', 'VEGETABLE'), 
#  ('garlic', 'VEGETABLE'), ('red peppers', 'VEGETABLE'), ('oranges', 'FRUIT'), 
#  ('chickens', 'MEAT')]


