Span एनोटेशन
Named entity recognition और अन्य कार्यों के लिए text span हाइलाइट और लेबल करें।
Span annotation एनोटेटर्स को टेक्स्ट के हिस्सों को चुनने और लेबल करने की अनुमति देता है, जो आमतौर पर named entity recognition (NER), part-of-speech tagging, और text highlighting कार्यों के लिए उपयोग किया जाता है।
बुनियादी कॉन्फ़िगरेशन
annotation_schemes:
- annotation_type: span
name: entities
description: "Highlight named entities in the text"
labels:
- PERSON
- ORGANIZATION
- LOCATIONकॉन्फ़िगरेशन विकल्प
Entity लेबल
एनोटेटर्स जो span प्रकार बना सकते हैं उन्हें परिभाषित करें:
labels:
- PERSON
- ORGANIZATION
- LOCATION
- DATE
- EVENTलेबल रंग
दृश्य अंतर के लिए रंग कस्टमाइज़ करें:
label_colors:
PERSON: "#3b82f6"
ORGANIZATION: "#10b981"
LOCATION: "#f59e0b"
DATE: "#8b5cf6"
EVENT: "#ec4899"रंग hex (#ff0000) या RGB (rgb(255, 0, 0)) हो सकते हैं।
कीबोर्ड शॉर्टकट
कीबोर्ड बाइंडिंग के साथ एनोटेशन तेज़ करें:
keyboard_shortcuts:
PERSON: "1"
ORGANIZATION: "2"
LOCATION: "3"
DATE: "4"Tooltip
प्रत्येक लेबल के लिए मार्गदर्शन प्रदान करें:
tooltips:
PERSON: "Names of people, characters, or personas"
ORGANIZATION: "Companies, agencies, institutions"
LOCATION: "Physical locations, addresses, geographic regions"ओवरलैपिंग Span
ओवरलैपिंग की अनुमति दें
ओवरलैप करने वाले span सक्षम करें:
- annotation_type: span
name: entities
labels:
- PERSON
- ROLE
allow_discontinuous: trueयह उपयोगी है जब एक ही टेक्स्ट के कई लेबल हो सकते हैं (जैसे, "Dr. Smith" PERSON और ROLE दोनों है)।
ओवरलैपिंग अक्षम करें (डिफ़ॉल्ट)
- annotation_type: span
name: entities
labels:
- PERSON
- ORGANIZATION
allow_discontinuous: false # Default behaviorSpan चयन मोड
शब्द-स्तरीय चयन
केवल पूर्ण शब्द चुनें:
- annotation_type: span
name: entities
labels:
- ENTITYवर्ण-स्तरीय चयन
आंशिक शब्दों के चयन की अनुमति दें:
- annotation_type: span
name: entities
labels:
- ENTITYपूर्व-एनोटेट Span
समीक्षा या सुधार के लिए मौजूदा एनोटेशन लोड करें:
{
"id": "doc1",
"text": "John Smith works at Microsoft in Seattle.",
"spans": [
{"start": 0, "end": 10, "label": "PERSON"},
{"start": 20, "end": 29, "label": "ORGANIZATION"},
{"start": 33, "end": 40, "label": "LOCATION"}
]
}पूर्व-एनोटेशन लोड करने के लिए कॉन्फ़िगर करें:
- annotation_type: span
name: entitiesसामान्य NER कॉन्फ़िगरेशन
मानक NER (4 प्रकार)
- annotation_type: span
name: ner
description: "Label named entities"
labels:
- PER # Person
- ORG # Organization
- LOC # Location
- MISC # Miscellaneous
sequential_key_binding:
PER: "1"
ORG: "2"
LOC: "3"
MISC: "4"विस्तारित NER (OntoNotes शैली)
- annotation_type: span
name: ner_extended
labels:
- PERSON
- NORP # Nationalities, religious/political groups
- FAC # Facilities
- ORG
- GPE # Geopolitical entities
- LOC
- PRODUCT
- EVENT
- WORK_OF_ART
- LAW
- LANGUAGE
- DATE
- TIME
- PERCENT
- MONEY
- QUANTITY
- ORDINAL
- CARDINALजैव चिकित्सा NER
- annotation_type: span
name: bio_ner
labels:
- GENE
- PROTEIN
- DISEASE
- DRUG
- SPECIESसोशल मीडिया NER
- annotation_type: span
name: social_ner
labels:
- PERSON
- ORGANIZATION
- LOCATION
- PRODUCT
- CREATIVE_WORK
- GROUPगुण के साथ Span
समृद्ध एनोटेशन के लिए span में गुण जोड़ें:
annotation_schemes:
- annotation_type: span
name: entities
labels:
- PERSON
- ORGANIZATION
- annotation_type: radio
name: entity_type
description: "What type of entity is this?"
labels:
- Named
- Nominal
- Pronominalएकाधिक Span स्कीमा
अलग-अलग पहलुओं को अलग-अलग एनोटेट करें:
annotation_schemes:
# Named entities
- annotation_type: span
name: entities
description: "Label named entities"
labels:
- PERSON
- ORGANIZATION
- LOCATION
# Sentiment expressions
- annotation_type: span
name: sentiment_spans
description: "Highlight sentiment expressions"
labels:
- POSITIVE
- NEGATIVEMulti-Field Span Annotation
v2.1.0 में नया
Span annotation target_field विकल्प का उपयोग करके multi-field डेटा में विशिष्ट टेक्स्ट फ़ील्ड को लक्षित कर सकता है। यह उपयोगी है जब आपके डेटा में कई टेक्स्ट फ़ील्ड हों और आप किसी विशेष एक में span एनोटेट करना चाहते हों।
कॉन्फ़िगरेशन
annotation_schemes:
- annotation_type: span
name: source_entities
description: "Label entities in the source text"
labels:
- PERSON
- ORGANIZATION
- annotation_type: span
name: summary_entities
description: "Label entities in the summary"
labels:
- PERSON
- ORGANIZATIONMulti-Field डेटा फॉर्मेट
आपके डेटा में अलग-अलग टेक्स्ट फ़ील्ड शामिल होने चाहिए:
{
"id": "doc1",
"source_text": "John Smith works at Microsoft in Seattle.",
"summary": "Smith is employed by Microsoft."
}आउटपुट फॉर्मेट
target_field का उपयोग करते समय, एनोटेशन फ़ील्ड के अनुसार कुंजीबद्ध होते हैं:
{
"id": "doc1",
"source_entities": {
"source_text": [
{"start": 0, "end": 10, "text": "John Smith", "label": "PERSON"},
{"start": 20, "end": 29, "text": "Microsoft", "label": "ORGANIZATION"}
]
},
"summary_entities": {
"summary": [
{"start": 0, "end": 5, "text": "Smith", "label": "PERSON"},
{"start": 22, "end": 31, "text": "Microsoft", "label": "ORGANIZATION"}
]
}
}एक पूर्ण कार्यशील उदाहरण के लिए, Potato रिपॉजिटरी में project-hub/simple_examples/simple-multi-span/ देखें।
प्रदर्शन विकल्प
Span में लेबल दिखाएँ
हाइलाइट किए गए span के भीतर लेबल टेक्स्ट प्रदर्शित करें:
- annotation_type: span
name: entitiesरेखांकन शैली
पृष्ठभूमि हाइलाइटिंग के बजाय रेखांकन का उपयोग करें:
- annotation_type: span
name: entitiesआउटपुट फॉर्मेट
Span एनोटेशन character offset के साथ सहेजे जाते हैं:
{
"id": "doc1",
"entities": [
{
"start": 0,
"end": 10,
"text": "John Smith",
"label": "PERSON"
},
{
"start": 20,
"end": 29,
"text": "Microsoft",
"label": "ORGANIZATION"
}
]
}पूर्ण उदाहरण: NER कार्य
task_name: "Named Entity Recognition"
data_files:
- path: data/documents.json
text_field: text
annotation_schemes:
- annotation_type: span
name: entities
description: "Highlight and label all named entities"
labels:
- PERSON
- ORGANIZATION
- LOCATION
- DATE
- MONEY
sequential_key_binding:
PERSON: "1"
ORGANIZATION: "2"
LOCATION: "3"
DATE: "4"
MONEY: "5"
allow_discontinuous: false
- annotation_type: radio
name: difficulty
description: "How difficult was this document to annotate?"
labels:
- Easy
- Medium
- Hardअसंतत Span
v2.2.0 में नया
allow_discontinuous पैरामीटर के साथ गैर-सन्निहित टेक्स्ट span सक्षम करें। यह एनोटेटर्स को एकल span एनोटेशन के रूप में कई गैर-आसन्न टेक्स्ट सेगमेंट चुनने की अनुमति देता है, जो असंतत entity या विभाजित अभिव्यक्तियों के लिए उपयोगी है।
- annotation_type: span
name: entities
labels:
- PERSON
- ORGANIZATION
allow_discontinuous: trueसक्षम होने पर, एनोटेटर वर्तमान span में अतिरिक्त टेक्स्ट सेगमेंट जोड़ने के लिए modifier key दबाकर अतिरिक्त टेक्स्ट सेगमेंट चुन सकते हैं। आउटपुट में प्रत्येक सेगमेंट के लिए कई start/end जोड़े शामिल होते हैं।
Entity Linking एकीकरण
v2.2.0 में नया
Span एनोटेशन को span स्कीमा में entity_linking कॉन्फ़िगरेशन ब्लॉक जोड़कर बाहरी knowledge base (Wikidata, UMLS, या कस्टम REST API) से जोड़ा जा सकता है:
- annotation_type: span
name: entities
labels:
- PERSON
- ORGANIZATION
- LOCATION
entity_linking:
enabled: true
knowledge_bases:
- name: wikidata
type: wikidata
language: enजब entity linking सक्षम होती है, तो प्रत्येक span के control bar पर एक लिंक आइकन दिखाई देता है। इसे क्लिक करने से मिलान करने वाली KB entity खोजने और लिंक करने के लिए एक search modal खुलता है। पूर्ण विवरण के लिए Entity लिंकिंग दस्तावेज़ीकरण देखें।
सर्वोत्तम प्रथाएँ
- आसान दृश्य अंतर के लिए विशिष्ट रंग का उपयोग करें
- प्रत्येक entity प्रकार के लिए उदाहरण के साथ स्पष्ट tooltip प्रदान करें
- तेज़ एनोटेशन के लिए कीबोर्ड शॉर्टकट सक्षम करें
- जब तक character सटीकता की आवश्यकता न हो, word-level selection का उपयोग करें
- तेज़ सुधार कार्यप्रवाह के लिए पूर्व-एनोटेशन पर विचार करें
- अपने एनोटेशन दिशानिर्देशों के आधार पर ओवरलैपिंग सेटिंग्स का परीक्षण करें
अधिक पढ़ें
- Entity लिंकिंग - Span को knowledge base से जोड़ें
- Coreference शृंखलाएँ - सह-संदर्भित उल्लेखों को समूहित करें
- घटना एनोटेशन - Span argument के साथ N-ary event संरचनाएँ
- Span लिंकिंग - Span के बीच संबंध बनाएँ
- इंस्टेंस डिस्प्ले - Span लक्ष्य के साथ multi-field सामग्री प्रदर्शन
- UI कॉन्फ़िगरेशन - Span रंग कस्टमाइज़ करें
- उत्पादकता सुविधाएँ - कीबोर्ड शॉर्टकट
कार्यान्वयन विवरण के लिए, स्रोत दस्तावेज़ीकरण देखें।