Skip to content

Commit 81f82fd

Browse files
YuriiMotovtiangolo
andauthored
🔧 Update LLM-prompt for abbr and dfn tags (#14747)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
1 parent ff72101 commit 81f82fd

7 files changed

Lines changed: 63 additions & 79 deletions

File tree

docs/de/docs/_llm-test.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Siehe Abschnitt `### Content of code snippets` im allgemeinen Prompt in `scripts
3535

3636
//// tab | Test
3737

38-
Gestern schrieb mein Freund: „Wenn man unkorrekt korrekt schreibt, hat man es unkorrekt geschrieben“. Worauf ich antwortete: „Korrekt, aber ‚unkorrekt‘ ist unkorrekterweise nicht ‚„unkorrekt“‘“.
38+
Gestern schrieb mein Freund: „Wenn man ‚incorrectly‘ korrekt schreibt, hat man es falsch geschrieben“. Worauf ich antwortete: „Korrekt, aber ‚incorrectly‘ ist inkorrekterweise nicht ‚„incorrectly“‘“.
3939

4040
/// note | Hinweis
4141

@@ -202,11 +202,6 @@ Hier einige Dinge, die in HTML-„abbr“-Elemente gepackt sind (einige sind erf
202202
* <abbr title="XML Web Token">XWT</abbr>
203203
* <abbr title="Paralleles Server-Gateway-Interface">PSGI</abbr>
204204

205-
### Das abbr gibt eine Erklärung { #the-abbr-gives-an-explanation }
206-
207-
* <abbr title="Eine Gruppe von Maschinen, die so konfiguriert sind, dass sie verbunden sind und in irgendeiner Weise zusammenarbeiten.">Cluster</abbr>
208-
* <abbr title="Eine Methode des Machine Learning, die künstliche neuronale Netze mit zahlreichen versteckten Schichten zwischen Eingabe- und Ausgabeschicht verwendet und so eine umfassende interne Struktur entwickelt">Deep Learning</abbr>
209-
210205
### Das abbr gibt eine vollständige Phrase und eine Erklärung { #the-abbr-gives-a-full-phrase-and-an-explanation }
211206

212207
* <abbr title="Mozilla Developer Network – Mozilla-Entwicklernetzwerk: Dokumentation für Entwickler, geschrieben von den Firefox-Leuten">MDN</abbr>
@@ -224,6 +219,11 @@ Siehe Abschnitt `### HTML abbr elements` im allgemeinen Prompt in `scripts/trans
224219

225220
////
226221

222+
## HTML „dfn“-Elemente { #html-dfn-elements }
223+
224+
* <dfn title="Eine Gruppe von Maschinen, die so konfiguriert sind, dass sie verbunden sind und in irgendeiner Weise zusammenarbeiten.">Cluster</dfn>
225+
* <dfn title="Eine Methode des Machine Learning, die künstliche neuronale Netze mit zahlreichen versteckten Schichten zwischen Eingabe- und Ausgabeschicht verwendet und so eine umfassende interne Struktur entwickelt">Deep Learning</dfn>
226+
227227
## Überschriften { #headings }
228228

229229
//// tab | Test
@@ -248,7 +248,7 @@ Die einzige strenge Regel für Überschriften ist, dass das LLM den Hash-Teil in
248248

249249
Siehe Abschnitt `### Headings` im allgemeinen Prompt in `scripts/translate.py`.
250250

251-
Für einige sprachspezifische Anweisungen, siehe z. B. den Abschnitt `### Headings` in `docs/de/llm-prompt.md`.
251+
Für einige sprachsspezifische Anweisungen, siehe z. B. den Abschnitt `### Headings` in `docs/de/llm-prompt.md`.
252252

253253
////
254254

docs/en/docs/_llm-test.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@ Here some things wrapped in HTML "abbr" elements (Some are invented):
202202
* <abbr title="XML Web Token">XWT</abbr>
203203
* <abbr title="Parallel Server Gateway Interface">PSGI</abbr>
204204

205-
### The abbr gives an explanation { #the-abbr-gives-an-explanation }
206-
207-
* <abbr title="A group of machines that are configured to be connected and work together in some way.">cluster</abbr>
208-
* <abbr title="A method of machine learning that uses artificial neural networks with numerous hidden layers between input and output layers, thereby developing a comprehensive internal structure">Deep Learning</abbr>
209-
210205
### The abbr gives a full phrase and an explanation { #the-abbr-gives-a-full-phrase-and-an-explanation }
211206

212207
* <abbr title="Mozilla Developer Network: documentation for developers, written by the Firefox people">MDN</abbr>
@@ -224,6 +219,11 @@ See section `### HTML abbr elements` in the general prompt in `scripts/translate
224219

225220
////
226221

222+
## HTML "dfn" elements { #html-dfn-elements }
223+
224+
* <dfn title="A group of machines that are configured to be connected and work together in some way.">cluster</dfn>
225+
* <dfn title="A method of machine learning that uses artificial neural networks with numerous hidden layers between input and output layers, thereby developing a comprehensive internal structure">Deep Learning</dfn>
226+
227227
## Headings { #headings }
228228

229229
//// tab | Test

docs/es/docs/_llm-test.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,10 @@ Aquí algunas cosas envueltas en elementos HTML "abbr" (algunas son inventadas):
202202
* <abbr title="XML Web Token - Token web XML">XWT</abbr>
203203
* <abbr title="Parallel Server Gateway Interface - Interfaz de pasarela de servidor paralela">PSGI</abbr>
204204

205-
### El abbr da una explicación { #the-abbr-gives-an-explanation }
206-
207-
* <abbr title="Un grupo de máquinas configuradas para estar conectadas y trabajar juntas de alguna manera.">clúster</abbr>
208-
* <abbr title="Un método de machine learning que usa redes neuronales artificiales con numerosas capas ocultas entre las capas de entrada y salida, desarrollando así una estructura interna completa">Deep Learning</abbr>
209-
210205
### El abbr da una frase completa y una explicación { #the-abbr-gives-a-full-phrase-and-an-explanation }
211206

212207
* <abbr title="Mozilla Developer Network - Red de Desarrolladores de Mozilla: documentación para desarrolladores, escrita por la gente de Firefox">MDN</abbr>
213-
* <abbr title="Input/Output: lectura o escritura de disco, comunicaciones de red.">I/O</abbr>.
208+
* <abbr title="Input/Output - Entrada/Salida: lectura o escritura de disco, comunicaciones de red.">I/O</abbr>.
214209

215210
////
216211

@@ -224,6 +219,11 @@ Consulta la sección `### HTML abbr elements` en el prompt general en `scripts/t
224219

225220
////
226221

222+
## Elementos HTML "dfn" { #html-dfn-elements }
223+
224+
* <dfn title="Un grupo de máquinas configuradas para estar conectadas y trabajar juntas de alguna manera.">clúster</dfn>
225+
* <dfn title="Un método de Machine Learning que usa redes neuronales artificiales con numerosas capas ocultas entre las capas de entrada y salida, desarrollando así una estructura interna completa">Deep Learning</dfn>
226+
227227
## Encabezados { #headings }
228228

229229
//// tab | Prueba
@@ -433,7 +433,7 @@ Para instrucciones específicas del idioma, mira p. ej. la sección `### Heading
433433
* el motor de plantillas
434434

435435
* la anotación de tipos
436-
* las anotaciones de tipos
436+
* la anotación de tipos
437437

438438
* el worker del servidor
439439
* el worker de Uvicorn

docs/ko/docs/_llm-test.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ works(foo="bar") # 이건 동작합니다 🎉
132132
일부 텍스트
133133
///
134134

135-
/// note Technical details | 기술 세부사항
135+
/// note | 기술 세부사항
136136
일부 텍스트
137137
///
138138

@@ -202,11 +202,6 @@ works(foo="bar") # 이건 동작합니다 🎉
202202
* <abbr title="XML Web Token - XML 웹 토큰">XWT</abbr>
203203
* <abbr title="Parallel Server Gateway Interface - 병렬 서버 게이트웨이 인터페이스">PSGI</abbr>
204204

205-
### abbr가 설명을 제공 { #the-abbr-gives-an-explanation }
206-
207-
* <abbr title="어떤 방식으로든 서로 연결되고 함께 작동하도록 구성된 머신들의 집합입니다.">cluster</abbr>
208-
* <abbr title="입력과 출력 계층 사이에 수많은 은닉 계층을 둔 인공 신경망을 사용하는 머신 러닝 방법으로, 이를 통해 포괄적인 내부 구조를 형성합니다">Deep Learning</abbr>
209-
210205
### abbr가 전체 문구와 설명을 제공 { #the-abbr-gives-a-full-phrase-and-an-explanation }
211206

212207
* <abbr title="Mozilla Developer Network - 모질라 개발자 네트워크: Firefox를 만드는 사람들이 작성한 개발자용 문서">MDN</abbr>
@@ -224,6 +219,11 @@ works(foo="bar") # 이건 동작합니다 🎉
224219

225220
////
226221

222+
## HTML "dfn" 요소 { #html-dfn-elements }
223+
224+
* <dfn title="어떤 방식으로든 서로 연결되고 함께 작동하도록 구성된 머신들의 집합입니다.">클러스터</dfn>
225+
* <dfn title="입력과 출력 계층 사이에 수많은 은닉 계층을 둔 인공 신경망을 사용하는 머신 러닝 방법으로, 이를 통해 포괄적인 내부 구조를 형성합니다">딥 러닝</dfn>
226+
227227
## 제목 { #headings }
228228

229229
//// tab | 테스트

docs/pt/docs/_llm-test.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,10 @@ Aqui estão algumas coisas envolvidas em elementos HTML "abbr" (algumas são inv
197197

198198
### O abbr fornece uma frase completa { #the-abbr-gives-a-full-phrase }
199199

200-
* <abbr title="Getting Things Done">GTD</abbr>
201-
* <abbr title="less than - menos que"><code>lt</code></abbr>
202-
* <abbr title="XML Web Token">XWT</abbr>
203-
* <abbr title="Parallel Server Gateway Interface - Interface de Gateway de Servidor Paralelo">PSGI</abbr>
204-
205-
### O abbr fornece uma explicação { #the-abbr-gives-an-explanation }
206-
207-
* <abbr title="Um grupo de máquinas configuradas para estarem conectadas e trabalharem juntas de alguma forma.">cluster</abbr>
208-
* <abbr title="Um método de aprendizado de máquina que usa redes neurais artificiais com numerosas camadas ocultas entre as camadas de entrada e saída, desenvolvendo assim uma estrutura interna abrangente">Deep Learning</abbr>
200+
* <abbr title="Getting Things Done – Fazer as Coisas">GTD</abbr>
201+
* <abbr title="less than – menos que"><code>lt</code></abbr>
202+
* <abbr title="XML Web Token – Token Web XML">XWT</abbr>
203+
* <abbr title="Parallel Server Gateway Interface – Interface de Gateway de Servidor Paralelo">PSGI</abbr>
209204

210205
### O abbr fornece uma frase completa e uma explicação { #the-abbr-gives-a-full-phrase-and-an-explanation }
211206

@@ -224,6 +219,11 @@ Veja a seção `### HTML abbr elements` no prompt geral em `scripts/translate.py
224219

225220
////
226221

222+
## Elementos HTML "dfn" { #html-dfn-elements }
223+
224+
* <dfn title="Um grupo de máquinas configuradas para estarem conectadas e trabalharem juntas de alguma forma.">cluster</dfn>
225+
* <dfn title="Um método de aprendizado de máquina que usa redes neurais artificiais com numerosas camadas ocultas entre as camadas de entrada e saída, desenvolvendo assim uma estrutura interna abrangente">Deep Learning</dfn>
226+
227227
## Títulos { #headings }
228228

229229
//// tab | Teste

docs/ru/docs/_llm-test.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@ works(foo="bar") # Это работает 🎉
202202
* <abbr title="XML Web Token - XML веб‑токен">XWT</abbr>
203203
* <abbr title="Parallel Server Gateway Interface - Параллельный серверный интерфейс шлюза">PSGI</abbr>
204204

205-
### abbr даёт объяснение { #the-abbr-gives-an-explanation }
206-
207-
* <abbr title="Группа машин, которые настроены на соединение и совместную работу определённым образом.">кластер</abbr>
208-
* <abbr title="Метод машинного обучения, который использует искусственные нейронные сети с многочисленными скрытыми слоями между входным и выходным слоями, тем самым формируя сложную внутреннюю структуру">Глубокое обучение</abbr>
209-
210205
### abbr даёт полную расшифровку и объяснение { #the-abbr-gives-a-full-phrase-and-an-explanation }
211206

212207
* <abbr title="Mozilla Developer Network - Сеть разработчиков Mozilla: документация для разработчиков, созданная командой Firefox">MDN</abbr>
@@ -224,6 +219,11 @@ works(foo="bar") # Это работает 🎉
224219

225220
////
226221

222+
## HTML-элементы "dfn" { #html-dfn-elements }
223+
224+
* <dfn title="Группа машин, которые настроены на соединение и совместную работу определённым образом.">кластер</dfn>
225+
* <dfn title="Метод машинного обучения, который использует искусственные нейронные сети с многочисленными скрытыми слоями между входным и выходным слоями, тем самым формируя сложную внутреннюю структуру">Глубокое обучение</dfn>
226+
227227
## Заголовки { #headings }
228228

229229
//// tab | Тест

scripts/general-llm-prompt.md

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ Erstelle eine [Virtuelle Umgebung](../virtual-environments.md){.internal-link ta
353353

354354
Translate HTML abbr elements (`<abbr title="description">text</abbr>`) as follows:
355355

356-
- If the text surrounded by the abbr element is an abbreviation (the text may be surrounded by further HTML or Markdown markup or quotes, for example <code>text</code> or `text` or "text", ignore that further markup when deciding if the text is an abbreviation), and if the description (the text inside the title attribute) contains the full phrase for this abbreviation, then append a dash (-) to the full phrase, followed by the translation of the full phrase.
356+
- The text inside abbr tag may be surrounded by further HTML or Markdown markup or quotes, for example <code>text</code> or `text` or "text". Preserve markup and only translate visible text inside the abbr element.
357+
358+
- If the description (the text inside the title attribute) contains the full phrase for this abbreviation, then append a dash (-) to the full phrase, followed by the translation of the full phrase.
357359

358360
Conversion scheme:
359361

@@ -421,45 +423,7 @@ Result (German):
421423
<abbr title="Asynchrones Server-Gateway-Interface">ASGI</abbr>
422424
```
423425

424-
- If the description is not a full phrase for an abbreviation which the abbr element surrounds, but some other information, then just translate the description.
425-
426-
Conversion scheme:
427-
428-
Source (English):
429-
430-
```
431-
<abbr title="{description}">{text}</abbr>
432-
```
433-
434-
Result:
435-
436-
```
437-
<abbr title="{translation of description}">{translation of text}</abbr>
438-
```
439-
440-
Examples:
441-
442-
Source (English):
443-
444-
```
445-
<abbr title="also known as: endpoints, routes">path</abbr>
446-
<abbr title="a program that checks for code errors">linter</abbr>
447-
<abbr title="converting the string that comes from an HTTP request into Python data">parsing</abbr>
448-
<abbr title="before 2023-03">0.95.0</abbr>
449-
<abbr title="2023-08-26">at the time of writing this</abbr>
450-
```
451-
452-
Result (German):
453-
454-
```
455-
<abbr title="auch bekannt als: Endpunkte, Routen">Pfad</abbr>
456-
<abbr title="Programm das auf Fehler im Code prüft">Linter</abbr>
457-
<abbr title="Konvertieren des Strings eines HTTP-Requests in Python-Daten">Parsen</abbr>
458-
<abbr title="vor 2023-03">0.95.0</abbr>
459-
<abbr title="2023-08-26">zum Zeitpunkt als das hier geschrieben wurde</abbr>
460-
```
461-
462-
- If the text surrounded by the abbr element is an abbreviation and the description contains both the full phrase for that abbreviation, and other information, separated by a colon (`:`), then append a dash (`-`) and the translation of the full phrase to the original full phrase and translate the other information.
426+
- If the title of abbr element contains a full phrase for that abbreviation, and other information, separated by a colon (`:`), then append a dash (`-`) and the translation of the full phrase to the original full phrase and translate the other information.
463427

464428
Conversion scheme:
465429

@@ -526,3 +490,23 @@ Result (German):
526490
- If there is an existing translation, and it has ADDITIONAL abbr elements in a sentence, and these additional abbr elements do not exist in the related sentence in the English text, then KEEP those additional abbr elements in the translation. Do not remove them. Except when you remove the whole sentence from the translation, because the whole sentence was removed from the English text, then also remove the abbr element. The reasoning for this rule is, that such additional abbr elements are manually added by the human editor of the translation, in order to translate or explain an English word to the human readers of the translation. These additional abbr elements would not make sense in the English text, but they do make sense in the translation. So keep them in the translation, even though they are not part of the English text. This rule only applies to abbr elements.
527491

528492
- Apply above rules also when there is an existing translation! Make sure that all title attributes in abbr elements get properly translated or updated, using the schemes given above. However, leave the ADDITIONAL abbr's described above alone. Do not change their formatting or content.
493+
494+
### HTML dfn elements
495+
496+
For HTML dfn elements (`<dfn>text</dfn>`), translate the text inside the dfn element and the title attribute. Do not include the original English text in the title attribute.
497+
498+
Examples:
499+
500+
Source (English):
501+
502+
```
503+
<dfn title="also known as: endpoints, routes">path</dfn>
504+
<dfn title="a program that checks for code errors">linter</dfn>
505+
```
506+
507+
Result (German):
508+
509+
```
510+
<dfn title="auch bekannt als: Endpunkte, Routen">Pfad</dfn>
511+
<dfn title="Programm das auf Fehler im Code prüft">Linter</dfn>
512+
```

0 commit comments

Comments
 (0)