2장. taxonomy 트리에 대한 지식 추가
세로미 트리를 사용자 지정할 수 있으므로 모델이 도메인별 정보를 배울 수 있습니다. RHEL AI의 경우 지식 데이터는 Git 리포지토리에서 호스팅됩니다. 지식 기여는 qna.yaml 파일을 사용하여 모델을 학습하려는 문서를 읽는 방법을 알아봅니다. 지식을 위한 각 qna.yaml 파일에는 다음 키가 있는 키-값 항목 세트가 포함되어 있습니다.
| 필드 | 설명 | Constraints | 예 |
|---|---|---|---|
|
| qna.yaml 파일에 사용되는 taxonomy 스키마 버전입니다. |
이 매개변수에 현재 지원되는 값은 |
|
|
| 기여자의 이름 또는 사용자 이름입니다. | - |
|
|
| 지식 문서의 제목 또는 범주입니다. 도메인은 합성 데이터 생성 중에 마스터 모델에 메시지를 표시하고 추가 컨텍스트를 추가합니다. |
|
토론에 대한 지식 문서의 경우, 도메인은
건강 보험 정보에 대한 지식 문서의 경우 도메인은 |
|
| 기술 문서에서 컨텍스트와 함께 질문 및 응답 쌍을 포함하는 필드입니다. |
|
|
|
| 지식 문서에서 정확히 가져온 정보 청크입니다. 마스터 모델을 안내하는 데 도움이 되도록 표, 단락 또는 목록을 포함하여 다양한 유형의 콘텐츠를 강조 표시합니다. | 각 qna.yaml에는 5개의 컨텍스트 블록이 필요하며 최대 500개의 토큰 수가 있습니다. |
|
|
| 모델이 학습할 수 있는 질문 및 응답이 포함된 필드입니다. |
각 |
|
|
| 관련 컨텍스트와 관련이 있고 접지된 질문입니다. 사실 기반, 추론 또는 설명을 포함하여 다양한 질문 및 질문 유형을 제공합니다. | 최대 250개의 토큰 수입니다. |
|
|
|
지정된 질문에 대한 응답입니다. 답변은 완전한 문장이어야 하며 | 최대 250개의 토큰 수입니다. |
|
|
| 문서에 대한 간략한 요약은 Thesis 문과 유사합니다. 이는 문서 콘텐츠에 대한 높은 수준의 컨텍스트를 제공합니다. |
자세한 내용이어야 하며 |
|
|
| 기술 자료의 출처가 포함된 필드입니다. | - |
|
|
| 기술 자료 파일이 포함된 Git 리포지토리의 URL입니다. | - |
|
|
| 리포지토리의 문서에 해당하는 전체 커밋 해시 | - | - |
|
| Git 리포지토리에 파일을 포함 |
유효한 값에는 |
|
qna.yaml을 생성하기 위한 추가 리소스
-
예제 매개변수가 있는 전체
qna.yaml파일은 샘플 지식 YAML 사양 설명서를 참조하십시오. - YAML 큐레이션 프로세스에 대한 전체 지침은 모델 성능 설명서 최적화를 위한 YAML 생성 사례를 참조하십시오.
2.1. 지식 YAML 파일 생성 링크 복사링크가 클립보드에 복사되었습니다!
다음 프로세스는 RHEL AI 툴셋을 사용하여 제공된 기술 파일에 대해 교육하는 qna.yaml 파일을 생성하는 방법을 보여줍니다.
사전 요구 사항
- 부팅 가능한 컨테이너 이미지를 사용하여 RHEL AI를 설치했습니다.
- git CLI를 설치했습니다.
-
InstructLab을 초기화하고
ilabCLI를 사용할 수 있습니다. - 시스템에서 root 사용자 액세스 권한이 있어야 합니다.
프로세스
- Git 리포지토리에서 지식 파일을 호스팅하므로 과세 기간을 업데이트할 때 작업 분기를 체크아웃해야 합니다.
- taxonomy 폴더로 이동합니다. RHEL AI에는 상호 작용할 준비가 된 taxonomy 트리가 포함되어 있습니다.
- taxonomy 디렉터리의 지식 폴더로 이동합니다.
기술 자료
qna.yaml파일을 추가할 taxonomy 트리에 디렉터리와 폴더를 추가합니다.taxonomy 트리의 파일 경로 예
taxonomy/knowledge/technical_documents/product_customer_cases/qna.yaml원하는 텍스트 편집기를 사용하여
qna.yaml파일을 생성합니다. YAML에는qna.yaml제목이 있어야 합니다.참고SDG가 제대로 작동하려면
컨텍스트청크를 5개 이상 포함하고 질문_and_answers 매개변수의 컨텍스트 값에 따라 약 3개의 질문이포함되어야 합니다.-
qna.yaml파일에 필요한 키를 추가하고 변경 사항을 저장합니다.qna.yaml파일 포맷에 대한 자세한 내용은 "Sample knowledge YAML specifications"을 참조하십시오.
검증
지식
qna.yaml파일이 적절한 형식인지 확인하려면 다음 명령을 실행합니다.$ ilab taxonomy diffCLI는 taxonomy 트리 및
qna.yaml파일이 유효하고 올바르게 포맷된 경우 표시됩니다. CLI에는 오류가 발생하는 모든 문제를 수정할 수 있는 위치도 표시됩니다.유효한 taxonomy 트리 및
qna.yaml파일의 출력 예knowledge/technical_documents/product_customer_cases/qna.yaml Taxonomy in /taxonomy/ is valid :)오류가 있는 잘못된 taxonomy 트리 및
qna.yaml파일의 출력 예9:15 error syntax error: mapping values are not allowed here (syntax) Reading taxonomy failed with the following error: 1 taxonomy with errors! Exiting.
2.1.1. 샘플 지식 YAML 사양 링크 복사링크가 클립보드에 복사되었습니다!
지식 기여는 qna.yaml 파일을 사용하여 모델을 학습하려는 문서를 읽는 방법을 알아봅니다. RHEL AI에서 합성 데이터 생성(SDG) 프로세스는 qna.yaml 시드 예제를 사용하여 많은 양의 인공 데이터를 생성합니다. 이 프로세스를 통해 모델은 제공된 샘플에 독점적으로 의존하는 대신 더 많은 데이터를 학습할 수 있습니다.
기술 자료 qna.yaml 파일 예
version: 3
domain: astronomy
document_outline: |
Information about the Phoenix Constellation including the
history, characteristics, and features of the stars in the constellation.
created_by: <user-name>
seed_examples:
- context: |
**Phoenix** is a minor constellation in the southern sky. Named after the mythical
Phoenix_(mythology), it was first depicted on a celestial atlas by Johann Bayerin his 1603
Uranometria. The French explorer and astronomer Nicolas Louis de Lacaille charted the brighter stars
and gave their Bayer designations in 1756. The constellation stretches from roughly −39 degrees to −57
degrees declination, and from 23.5h to 2.5h of right ascension. The constellations Phoenix, Grus,
Pavo and Tucana are known as the Southern Birds.
questions_and_answers:
- question: |
What is the Phoenix constellation?
answer: |
The Phoenix constellation is a minor constellation in the southern sky.
- question: |
Who charted the Phoenix constellation?
answer: |
The Phoenix constellation was charted by french explorer and
astronomer Nicolas Louis de Lacaille.
- question: |
How far does the Phoenix constellation stretch?
answer: |
The phoenix constellation stretches from roughly −39° to −57°
declination, and from 23.5h to 2.5h of right ascension.
- context: |
Phoenix was the largest of the 12 constellations established by Petrus Plancius from the observations
of Pieter Dirkszoon Keyser and Frederick de Houtman. It first appeared on a 35cm diameter celestial globe
published in 1597 (or 1598) in Amsterdam by Plancius with Jodocus Hondius. The first depiction of this
constellation in a celestial atlas was in Johann Bayer *Uranometria* of 1603. De Houtman included it in
his southern star catalog the same year under the Dutch name *Den voghel Fenicx*, "The Bird Phoenix",
symbolising the phoenix of classical mythology. One name of the brightest star Alpha Phoenicis—Ankaa—is
derived from the Arabic: العنقاء, romanized: al-‘anqā’, lit. 'the phoenix', and was coined sometime after
1800 in relation to the constellation.
questions_and_answers:
- question: |
What is the brightest star in the Phoenix constellation
called?
answer: |
Alpha Phoenicis or Ankaa is the brightest star in the Phoenix
Constellation.
- question: Where did the Phoenix constellation first appear?
answer: |
The Phoenix constellation first appeared on a 35-cm diameter
celestial globe published in 1597 (or 1598) in Amsterdam by
Plancius with Jodocus Hondius.
- question: |
What does "The Bird Phoenix" symbolize?
answer: |
"The Bird Phoenix" symbolizes the phoenix of classical mythology.
- context: |
Phoenix is a small constellation bordered by Fornax and Sculptor to the north, Grus to the west,
Tucana to the south, touching on the corner of Hydrus to the south, and Eridanus to the east and southeast.
The bright star Achernar is nearby. The three-letter abbreviation for the constellation, as adopted by
the International Astronomical Union in 1922, is "Phe". The official constellation boundaries,
as set by Belgian astronomer Eugène Delporte in 1930, are defined by a polygon of 10 segments.
In the equatorial coordinate system, the right ascension coordinates of these borders lie
between 23<sup>h</sup> 26.5<sup>m</sup> and 02<sup>h</sup> 25.0<sup>m</sup>,
while the declination coordinates are between −39.31° and −57.84°. This means it remains
below the horizon to anyone living north of the 40th parallel in the Northern
Hemisphere, and remains low in the sky for anyone living north of the equator. It is most
visible from locations such as Australia and South Africa during late Southern Hemisphere spring.
Most of the constellation lies within, and can be located by, forming a triangle of the bright
stars Achernar, Fomalhaut and Beta Ceti—Ankaa lies roughly in the centre of this.
questions_and_answers:
- question: What are the characteristics of the Phoenix constellation?
answer: |
Phoenix is a small constellation bordered by Fornax and Sculptor to
the north, Grus to the west, Tucana to the south, touching on the
corner of Hydrus to the south, and Eridanus to the east and southeast.
The bright star Achernar is nearby.
- question: |
When is the phoenix constellation most visible?
answer: |
Phoenix is most visible from locations such as Australia and
South Africa during late Southern Hemisphere spring.
- question: |
What are the Phoenix Constellation boundaries?
answer: |
The official constellation boundaries for Phoenix, as set by Belgian
astronomer Eugène Delporte in 1930, are defined by a polygon of 10
segments.
- context: |
Ten stars have been found to have planets to date, and four planetary systems have been
discovered with the SuperWASP project. HD 142 is a yellow giant that has an apparent magnitude
of 5.7, and has a planet (HD 142b) 1.36 times the mass of Jupiter which orbits every 328 days.
HD 2039 is a yellow subgiant with an apparent magnitude of 9.0 around 330 light years away which
has a planet (HD 2039) six times the mass of Jupiter. WASP-18 is a star of magnitude 9.29 which
was discovered to have a hot Jupiter-like planet (WASP-18b) taking less than a day to orbit the star.
The planet is suspected to be causing WASP-18 to appear older than it really is. WASP-4and WASP-5
are solar-type yellow stars around 1000 light years distant and of 13th magnitude, each with a single
planet larger than Jupiter. WASP-29 is an orange dwarf of spectral type K4V and visual magnitude 11.3,
which has a planetary companion of similar size and mass to Saturn. The planet completes an orbit
every 3.9 days.
questions_and_answers:
- question: In the Phoenix constellation, how many stars have planets?
answer: |
In the Phoenix constellation, ten stars have been found to have
planets to date, and four planetary systems have been discovered
with the SuperWASP project.
- question: |
What is HD 142?
answer: |
HD 142 is a yellow giant that has an apparent magnitude of 5.7, and
has a planet (HD 142 b) 1.36 times the mass of Jupiter which
orbits every 328 days.
- question: |
Are WASP-4 and WASP-5 solar-type yellow stars?
answer: |
Yes, WASP-4 and WASP-5 are solar-type yellow stars around 1000 light
years distant and of 13th magnitude, each with a single planet
larger than Jupiter.
- context: |
The constellation does not lie on the galactic plane of the Milky Way, and there are no prominent star
clusters. NGC 625 is a dwarf irregular galaxy of apparent magnitude 11.0 and lying some 12.7 million
light years distant. Only 24000 light years in diameter, it is an outlying member of the Sculptor Group.
NGC 625 is thought to have been involved in a collision and is experiencing a burst of active star formation.
NGC 37 is a lenticular galaxy of apparent magnitude 14.66. It is approximately 42 kiloparsecs 137,000
light-years in diameter and about 12.9 billion years old. Robert's Quartet composed of the irregular galaxy
NGC 87, and three spiral galaxies NGC 88, NGC 89 and NGC 92 is a group of four galaxies located around 160 million
light-years away which are in the process of colliding and merging. They are within a circle of radius of 1.6 arcmin,
corresponding to about 75,000 light-years. Located in the galaxy ESO 243-49 is HLX-1, an intermediate-mass
black hole—the first one of its kind identified. It is thought to be a remnant of a dwarf galaxy that was absorbed
in a collision with ESO 243-49. Before its discovery, this class of black hole was only hypothesized.
questions_and_answers:
- question: |
Is the Phoenix Constellation part of the Milky Way?
answer: |
The Phoenix constellation does not lie on the galactic plane of
the Milky Way, and there are no prominent star clusters.
- question: |
How many light years away is NGC 625?
answer: |
NGC 625 is 24000 light years in diameter and is an outlying
member of the Sculptor Group.
- question: |
What is Robert's Quartet composed of?
answer: |
Robert's Quartet is composed of the irregular galaxy NGC 87,
and three spiral galaxies NGC 88, NGC 89 and NGC 92.
document:
repo: https://github.com/<profile>/<repo-name> /
commit: <commit hash>
patterns:
- phoenix_constellation.md
- phoenix_history.md
- 1
- 기술 자료
qna.yaml형식의 버전을 지정합니다. 현재 유효한 값은3입니다. - 2
- 문서의 제목 또는 범주를 지정합니다. 예를 들어 "기술 문서" 또는 "설치 가이드"입니다.
- 3
- 문서의 콘텐츠에 대한 개요를 지정합니다.
document_outline필드의context매개 변수에 포함하는 주체를 참조하는 것이 좋습니다. 예를 들어 문서가 설치 가이드이고 각컨텍스트에다른 클라우드 공급자에 대한 세부 정보가 포함된 경우document_outline은 "AWS, GCP 및 Azure 설치 가이드"가 됩니다. - 4
- 이름 또는 git 사용자 이름을 지정합니다.
- 5
- 기술 자료 단락을 지정합니다. 이는 귀하의 질문 및 답변을 기반으로 하는 내용입니다. 컨텍스트 블록 형식은 기술 자료 파일의 형식과 일치해야 합니다. 예를 들어 기술 문서가 마크다운에 있는 경우
컨텍스트블록도 마크다운 형식이어야 합니다. - 6
- 모델에 대한 질문을 지정합니다. 문제는
컨텍스트필드의 정보를 기반으로 해야 합니다. 예를 들어 "제품의 최신 버전은 무엇입니까?". - 7
- 모델에서 원하는 응답을 지정합니다. 답변에 대한 정보는
컨텍스트블록에서 포함하되 복사되지 않아야 하며 완전한 문장이어야 합니다. 답변은 완전한 문장이어야 합니다. 예를 들어 "제품의 최신 버전은 버전 1.5"입니다. - 8
- 기술 자료 파일이 포함된 리포지토리의 URL을 지정합니다.
- 9
- 기술 파일의 git 리포지토리에서 커밋의 SHA를 지정합니다.
- 10
- git 리포지토리에 문서를 지정합니다. 유효한 문서 유형 값에는
.md또는.pdf가 포함됩니다. 단일qna.yaml파일은 하나의 문서 유형만 참조할 수 있으며 동일한qna.yaml내의 파일 유형을 혼합하는 것은 지원되지 않습니다.