mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Add Zshot Spacy plugin (#11557)
* Add Zshot Spacy plugin Add Zshot (Zero and Few shot named entity & relationships recognition) Spacy plugin * Update website/meta/universe.json Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com> * Update website/meta/universe.json Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com> Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
This commit is contained in:
parent
bcda8bc1e7
commit
ff9002b726
|
@ -1,5 +1,62 @@
|
|||
{
|
||||
"resources": [
|
||||
{
|
||||
"id": "Zshot",
|
||||
"title": "Zshot",
|
||||
"slogan": "Zero and Few shot named entity & relationships recognition",
|
||||
"github": "ibm/zshot",
|
||||
"pip": "zshot",
|
||||
"code_example": [
|
||||
"import spacy",
|
||||
"from zshot import PipelineConfig, displacy",
|
||||
"from zshot.linker import LinkerRegen",
|
||||
"from zshot.mentions_extractor import MentionsExtractorSpacy",
|
||||
"from zshot.utils.data_models import Entity",
|
||||
"",
|
||||
"nlp = spacy.load('en_core_web_sm')",
|
||||
"# zero shot definition of entities",
|
||||
"nlp_config = PipelineConfig(",
|
||||
" mentions_extractor=MentionsExtractorSpacy(),",
|
||||
" linker=LinkerRegen(),",
|
||||
" entities=[",
|
||||
" Entity(name='Paris',",
|
||||
" description='Paris is located in northern central France, in a north-bending arc of the river Seine'),",
|
||||
" Entity(name='IBM',",
|
||||
" description='International Business Machines Corporation (IBM) is an American multinational technology corporation headquartered in Armonk, New York'),",
|
||||
" Entity(name='New York', description='New York is a city in U.S. state'),",
|
||||
" Entity(name='Florida', description='southeasternmost U.S. state'),",
|
||||
" Entity(name='American',",
|
||||
" description='American, something of, from, or related to the United States of America, commonly known as the United States or America'),",
|
||||
" Entity(name='Chemical formula',",
|
||||
" description='In chemistry, a chemical formula is a way of presenting information about the chemical proportions of atoms that constitute a particular chemical compound or molecul'),",
|
||||
" Entity(name='Acetamide',",
|
||||
" description='Acetamide (systematic name: ethanamide) is an organic compound with the formula CH3CONH2. It is the simplest amide derived from acetic acid. It finds some use as a plasticizer and as an industrial solvent.'),",
|
||||
" Entity(name='Armonk',",
|
||||
" description='Armonk is a hamlet and census-designated place (CDP) in the town of North Castle, located in Westchester County, New York, United States.'),",
|
||||
" Entity(name='Acetic Acid',",
|
||||
" description='Acetic acid, systematically named ethanoic acid, is an acidic, colourless liquid and organic compound with the chemical formula CH3COOH'),",
|
||||
" Entity(name='Industrial solvent',",
|
||||
" description='Acetamide (systematic name: ethanamide) is an organic compound with the formula CH3CONH2. It is the simplest amide derived from acetic acid. It finds some use as a plasticizer and as an industrial solvent.'),",
|
||||
" ]",
|
||||
")",
|
||||
"nlp.add_pipe('zshot', config=nlp_config, last=True)",
|
||||
"",
|
||||
"text = 'International Business Machines Corporation (IBM) is an American multinational technology corporation' \\",
|
||||
" ' headquartered in Armonk, New York, with operations in over 171 countries.'",
|
||||
"",
|
||||
"doc = nlp(text)",
|
||||
"displacy.serve(doc, style='ent')"
|
||||
],
|
||||
"thumb": "https://ibm.github.io/zshot/img/graph.png",
|
||||
"url": "https://ibm.github.io/zshot/",
|
||||
"author": "IBM Research",
|
||||
"author_links": {
|
||||
"github": "ibm",
|
||||
"twitter": "IBMResearch",
|
||||
"website": "https://research.ibm.com/labs/ireland/"
|
||||
},
|
||||
"category": ["scientific", "models", "research"]
|
||||
},
|
||||
{
|
||||
"id": "concepcy",
|
||||
"title": "concepCy",
|
||||
|
|
Loading…
Reference in New Issue
Block a user