crowd-entity-annotation - 아마존 SageMaker

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

crowd-entity-annotation

더 긴 텍스트 내에서 단어, 구 또는 문자열에 레이블을 지정하기 위한 위젯입니다. 작업자는 레이블을 선택하고 레이블이 적용되는 텍스트를 강조 표시합니다.

중요: 독립형 위젯

<crowd-entity-annotation> 요소를 <crowd-form> 요소와 함께 사용하지 마십시오. 자체 양식 제출 논리 및 제출 버튼이 포함되어 있습니다.

CodePen에서 이 Crowd HTML 요소를 사용하는 HTML 템플릿의 대화형 예제를 참고해 보십시오.

다음은 <crowd-entity-annotation> 요소를 사용하는 템플릿 예제입니다. 다음 코드를 복사하여 확장자가 .html인 파일에 저장합니다. 브라우저에서 파일을 열어 이 템플릿을 미리 보고 상호 작용합니다.

<script src="https://assets.crowd.aws/crowd-html-elements.js"></script> <crowd-entity-annotation name="crowd-entity-annotation" header="Highlight parts of the text below" labels="[{'label': 'person', 'shortDisplayName': 'per', 'fullDisplayName': 'Person'}, {'label': 'date', 'shortDisplayName': 'dat', 'fullDisplayName': 'Date'}, {'label': 'company', 'shortDisplayName': 'com', 'fullDisplayName': 'Company'}]" text="Amazon SageMaker Ground Truth helps you build highly accurate training datasets for machine learning quickly." > <full-instructions header="Named entity recognition instructions"> <ol> <li><strong>Read</strong> the text carefully.</li> <li><strong>Highlight</strong> words, phrases, or sections of the text.</li> <li><strong>Choose</strong> the label that best matches what you have highlighted.</li> <li>To <strong>change</strong> a label, choose highlighted text and select a new label.</li> <li>To <strong>remove</strong> a label from highlighted text, choose the X next to the abbreviated label name on the highlighted text.</li> <li>You can select all of a previously highlighted text, but not a portion of it.</li> </ol> </full-instructions> <short-instructions> Apply labels to words or phrases. </short-instructions> <div id="additionalQuestions" style="margin-top: 20px"> <h3> What is the overall subject of this text? </h3> <crowd-radio-group> <crowd-radio-button name="tech" value="tech">Technology</crowd-radio-button> <crowd-radio-button name="politics" value="politics">Politics</crowd-radio-button> </crowd-radio-group> </div> </crowd-entity-annotation> <script> document.addEventListener('all-crowd-elements-ready', () => { document .querySelector('crowd-entity-annotation') .shadowRoot .querySelector('crowd-form') .form .appendChild(additionalQuestions); }); </script>

Attributes

이 요소는 다음 속성을 지원합니다.

header

이미지 위에 표시되는 텍스트입니다. 일반적으로 작업자를 위한 간단한 지침 또는 질문입니다.

initial-value

JSON 형식의 객체 배열이며, 각각 초기화 시 텍스트에 적용할 주석을 정의합니다. 객체에는 labels 속성의 값과 일치하는 label 값, 레이블이 지정된 span의 시작 유니코드 오프셋에 대한 정수 startOffset 값 및 종료 유니코드 오프셋에 대한 정수 endOffset 값이 포함됩니다.

[ { label: 'person', startOffset: 0, endOffset: 16 }, ... ]

레이블

JSON 형식의 객체 배열이며, 각각 다음 항목을 포함합니다.

  • label(필수): 엔터티를 식별하는 데 사용되는 이름입니다.

  • fullDisplayName(선택): 작업 위젯의 레이블 목록에 사용됩니다. 지정하지 않는 경우 레이블 값이 기본값입니다.

  • shortDisplayName(선택): 선택한 엔터티 위에 표시되는 3~4자 약어입니다. 지정하지 않는 경우 레이블 값이 기본값입니다.

    shortDisplayName이 적극적으로 권장됩니다.

    선택 항목 위에 표시되는 값이 중복되며 작업 공간에서 레이블이 지정된 엔터티를 관리하기 어려울 수 있습니다. 중복을 방지하고 작업자가 작업 공간을 관리할 수 있도록 각 레이블에 3~4자 shortDisplayName을 제공하는 것이 좋습니다.

[ { label: 'person', shortDisplayName: 'per', fullDisplayName: 'person' } ]

name

DOM에서 위젯의 이름으로 사용됩니다. 양식 출력 및 출력 매니페스트의 레이블 속성 이름으로도 사용됩니다.

text

주석을 작성할 텍스트입니다. 템플릿 시스템은 기본적으로 따옴표와 HTML 문자열을 이스케이프 처리합니다. 코드가 이미 이스케이프 처리되었거나 부분적으로 이스케이프 처리된 경우 이스케이프를 제어하는 자세한 내용은 변수 필터 단원을 참조하십시오.

요소 계층 구조

이 요소에는 다음과 같은 상위 및 하위 요소가 포함되어 있습니다.

리전

이 요소는 다음 영역을 지원합니다.

full-instructions

위젯을 작동하는 방법에 대한 일반 지침

short-instructions

눈에 띄는 위치에 표시되는 중요한 작업 관련 지침입니다.

출력

이 요소는 다음 출력을 지원합니다.

엔터티

주석의 시작, 끝 및 레이블을 지정하는 JSON 객체입니다. 이 객체는 다음 속성을 포함하고 있습니다.

  • label – 할당된 레이블.

  • startOffset – 선택한 텍스트 시작 부분의 유니코드 오프셋.

  • endOffset – 선택 항목 다음 첫 번째 문자의 유니코드 오프셋.

예 : 샘플 요소 출력

다음은 이 요소의 샘플 출력입니다.

{ "myAnnotatedResult": { "entities": [ { "endOffset": 54, "label": "person", "startOffset": 47 }, { "endOffset": 97, "label": "event", "startOffset": 93 }, { "endOffset": 219, "label": "date", "startOffset": 212 }, { "endOffset": 271, "label": "location", "startOffset": 260 } ] } }

참고 항목

자세한 내용은 다음을 참조하세요.