Healthcare용 AutoML Entity Extraction은 커스텀 Healthcare Natural Language 모델을 학습하기 위한 시작점을 제공합니다.
학습 데이터 준비
Healthcare용 AutoML Entity Extraction을 학습시키려면 분석하고자 하는 의료 텍스트 유형의 대표 샘플을 제공하고, 커스텀 모델이 식별하려고 하는 항목 유형을 식별하는 라벨이 주석으로 표시되어 있습니다. 학습 데이터를 컴파일할 때 다음 권장사항을 고려하세요.
- 커스텀 모델 학습을 위해서는 의료 텍스트 샘플을 50개에서 100,000개까지 제공해야 합니다.
- 1개에서 100개 사이의 고유 라벨로 의료 텍스트에 라벨을 지정하여 모델에서 추출하는 방법을 학습하려는 항목에 주석을 추가할 수 있습니다.
- 각 주석에는 텍스트와 관련 라벨이 포함됩니다.
- 라벨 이름은 2~30자 사이여야 합니다.
- 각 라벨은 1~10개의 단어로 주석을 추가할 수 있습니다.
- 모델을 효과적으로 학습시키려면 학습 데이터 세트에서 각 라벨을 최소 200번 사용해야 합니다.
의료 인보이스 또는 동의 양식처럼 구조화된 문서 또는 반구조화된 문서 유형에 주석을 추가하는 경우 AutoML Natural Language는 페이지 내 주석의 위치를 라벨의 적절성을 판단하는 요소로 고려할 수 있습니다.
학습 문서 형식 지정
학습 문서 형식을 지정하려면 학습 데이터를 AutoML Natural Language에 샘플 텍스트와 문서가 포함된 JSONL 파일로 업로드합니다. 파일의 각 줄은 다음 형식 중 하나로 지정된 단일 학습 문서입니다.
- UTF-8로 인코딩된 10~10,000 바이트 길이의 전체 문서 콘텐츠
- 프로젝트와 연결된 Cloud Storage 버킷에서 PDF 파일의 URI
주석이 없는 문서를 업로드한 후 AutoML Natural Language UI에서 텍스트 문서를 업로드하기 전에 직접 주석을 달거나 UI에서 이전에 주석 처리된 문서에 주석을 추가할 수 있습니다.
JSONL 문서
AutoML Natural Language는 JSONL 학습 파일을 만드는 데 유용하도록 일반 텍스트 파일을 올바르게 형식이 지정된 JSONL 파일로 변환하는 Python 스크립트를 제공합니다. 자세한 내용은 스크립트 내 댓글을 참조하세요.
JSONL 파일의 각 문서는 다음 형식 중 하나여야 합니다.
주석이 없는 문서의 경우:
{ "text_snippet": {"content": string} }
주석이 추가된 문서의 경우:
{ "annotations": [ { "text_extraction": { "text_segment": { "end_offset": number, "start_offset": number } }, "display_name": string }, { "text_extraction": { "text_segment": { "end_offset": number, "start_offset": number } }, "display_name": string }, ... ], "text_snippet": {"content": string} }
샘플 JSONL 파일에서 다음 작업을 수행합니다.
- 각
text_extraction
요소는text_snippet.content
내의 주석을 식별합니다.text_extraction
은text_snippet.content
의 시작부터 문서의 시작(start_offset
)과 끝(end_offset
) 사이의 문자 수를 지정하여 주석 처리된 텍스트의 위치를 나타냅니다. display_name
은 항목의 라벨입니다.start_offset
및end_offset
은 바이트 오프셋이 아닌 문자 오프셋입니다.end_offset
의 문자는 텍스트에 포함되지 않습니다.
자세한 내용은 TextSegment
를 참조하세요.
text_extraction
요소는 선택사항이며, AutoML Natural Language UI를 사용하여 문서에 주석을 추가할 경우에는 생략해도 됩니다. 각 주석에는 최대 10개의 토큰(일반적으로는 단어)이 포함될 수 있습니다. 이러한 토큰은 겹칠 수 없고, 주석의 start_offset
은 동일 문서 내 다른 주석의 start_offset
과 end_offset
사이에 있을 수 없습니다.
다음 샘플 학습 문서는 NCBI 코퍼스의 초록에서 언급된 특정 질병을 식별합니다.
{ "annotations": [ { "text_extraction": { "text_segment": { "end_offset": 67, "start_offset": 62 } }, "display_name": "Modifier" }, { "text_extraction": { "text_segment": { "end_offset": 158, "start_offset": 141 } }, "display_name": "SpecificDisease" }, { "text_extraction": { "text_segment": { "end_offset": 330, "start_offset": 290 } }, "display_name": "SpecificDisease" }, { "text_extraction": { "text_segment": { "end_offset": 337, "start_offset": 332 } }, "display_name": "SpecificDisease" }, { "text_extraction": { "text_segment": { "end_offset": 627, "start_offset": 610 } }, "display_name": "Modifier" }, { "text_extraction": { "text_segment": { "end_offset": 754, "start_offset": 749 } }, "display_name": "Modifier" }, { "text_extraction": { "text_segment": { "end_offset": 875, "start_offset": 865 } }, "display_name": "Modifier" }, { "text_extraction": { "text_segment": { "end_offset": 968, "start_offset": 951 } }, "display_name": "Modifier" }, { "text_extraction": { "text_segment": { "end_offset": 1553, "start_offset": 1548 } }, "display_name": "Modifier" }, { "text_extraction": { "text_segment": { "end_offset": 1652, "start_offset": 1606 } }, "display_name": "CompositeMention" }, { "text_extraction": { "text_segment": { "end_offset": 1833, "start_offset": 1826 } }, "display_name": "DiseaseClass" }, { "text_extraction": { "text_segment": { "end_offset": 1860, "start_offset": 1843 } }, "display_name": "SpecificDisease" }, { "text_extraction": { "text_segment": { "end_offset": 1930, "start_offset": 1913 } }, "display_name": "SpecificDisease" }, { "text_extraction": { "text_segment": { "end_offset": 2129, "start_offset": 2111 } }, "display_name": "SpecificDisease" }, { "text_extraction": { "text_segment": { "end_offset": 2188, "start_offset": 2160 } }, "display_name": "SpecificDisease" }, { "text_extraction": { "text_segment": { "end_offset": 2260, "start_offset": 2243 } }, "display_name": "Modifier" }, { "text_extraction": { "text_segment": { "end_offset": 2356, "start_offset": 2339 } }, "display_name": "Modifier" } ], "text_snippet": { "content": "10051005\tA common MSH2 mutation in English and North American HNPCC families: origin, phenotypic expression, and sex specific differences in colorectal cancer .\tThe frequency , origin , and phenotypic expression of a germline MSH2 gene mutation previously identified in seven kindreds with hereditary non-polyposis cancer syndrome (HNPCC) was investigated . The mutation ( A-- > T at nt943 + 3 ) disrupts the 3 splice site of exon 5 leading to the deletion of this exon from MSH2 mRNA and represents the only frequent MSH2 mutation so far reported . Although this mutation was initially detected in four of 33 colorectal cancer families analysed from eastern England , more extensive analysis has reduced the frequency to four of 52 ( 8 % ) English HNPCC kindreds analysed . In contrast , the MSH2 mutation was identified in 10 of 20 ( 50 % ) separately identified colorectal families from Newfoundland . To investigate the origin of this mutation in colorectal cancer families from England ( n = 4 ) , Newfoundland ( n = 10 ) , and the United States ( n = 3 ) , haplotype analysis using microsatellite markers linked to MSH2 was performed . Within the English and US families there was little evidence for a recent common origin of the MSH2 splice site mutation in most families . In contrast , a common haplotype was identified at the two flanking markers ( CA5 and D2S288 ) in eight of the Newfoundland families . These findings suggested a founder effect within Newfoundland similar to that reported by others for two MLH1 mutations in Finnish HNPCC families . We calculated age related risks of all , colorectal , endometrial , and ovarian cancers in nt943 + 3 A-- > T MSH2 mutation carriers ( n = 76 ) for all patients and for men and women separately . For both sexes combined , the penetrances at age 60 years for all cancers and for colorectal cancer were 0 . 86 and 0 . 57 , respectively . The risk of colorectal cancer was significantly higher in males than females ( 0 . 63 v 0 . 30 and 0 . 84 v 0 . 44 at ages 50 and 60 years , respectively ) . For females there was a high risk of endometrial cancer ( 0 . 5 at age 60 years ) and premenopausal ovarian cancer ( 0 . 2 at 50 years ) . These intersex differences in colorectal cancer risks have implications for screening programmes and for attempts to identify colorectal cancer susceptibility modifiers .\n " } }
PDF 문서
각 문서는 JSONL 파일의 한 줄을 나타냅니다. 아래 샘플에는 가독성을 위해 줄바꿈이 포함되어 있습니다. JSONL 파일에서 이 줄바꿈을 제거해야 합니다.
자세한 내용은 jsonlines.org를 참조하세요. PDF 파일을 문서로 업로드하려면 다음 샘플과 같이 파일 경로를 JSONL document
요소 내에 래핑합니다.
{ "document": { "input_config": { "gcs_source": { "input_uris": [ "gs://cloud-ml-data/NL-entity/sample.pdf" ] } } } }
input_uris
요소의 값은 프로젝트와 연결된 Cloud Storage 버킷에 있는 PDF 파일에 대한 경로입니다. PDF 파일의 최대 크기는 2MB입니다.