Skip to content
此页面尚未提供您所选语言的版本,当前显示英文版本。

Input testo e numero

Input di testo libero e numerico per le annotazioni.

Input testo e numero

Gli input di testo e numero consentono agli annotatori di fornire risposte in formato libero, utili per correzioni, spiegazioni, conteggi e misurazioni.

Input di testo

Campo di testo di base

Input di testo su una sola riga:

yaml
annotation_schemes:
  - annotation_type: text
    name: correction
    description: "Provide a corrected version of the text"

Area di testo (multi-riga)

Per risposte più lunghe:

yaml
- annotation_type: text
  name: explanation
  description: "Explain your reasoning"
  textarea: true

Testo segnaposto

Guida gli annotatori con un input di esempio:

yaml
- annotation_type: text
  name: summary
  description: "Write a one-sentence summary"
  placeholder: "Enter your summary here..."

Limiti di caratteri

Limita la lunghezza della risposta:

yaml
- annotation_type: text
  name: title
  description: "Suggest a title"
  min_length: 10
  max_length: 100

Testo obbligatorio

Rendi il campo obbligatorio:

yaml
- annotation_type: text
  name: justification
  description: "Why did you choose this label?"
  required: true

Input numerico

Campo numerico di base

yaml
annotation_schemes:
  - annotation_type: number
    name: count
    description: "How many entities are mentioned?"

Vincoli di intervallo

Imposta valori minimi e massimi:

yaml
- annotation_type: number
  name: rating
  description: "Rate from 1 to 10"
  min: 1
  max: 10

Dimensione del passo

Controlla la precisione dell'incremento:

yaml
- annotation_type: number
  name: percentage
  description: "What percentage is relevant?"
  min: 0
  max: 100
  step: 5  # Increments of 5

Numeri decimali

Consenti valori in virgola mobile:

yaml
- annotation_type: number
  name: score
  description: "Confidence score"
  min: 0.0
  max: 1.0
  step: 0.1

Valore predefinito

Pre-compila con un valore predefinito:

yaml
- annotation_type: number
  name: count
  description: "Number of errors"
  default: 0
  min: 0

Input con cursore

Alternativa visiva all'input numerico:

yaml
- annotation_type: slider
  name: confidence
  description: "How confident are you?"
  min: 0
  max: 100
  step: 1

Cursore con etichette

Aggiungi etichette agli estremi:

yaml
- annotation_type: slider
  name: agreement
  description: "How much do you agree?"
  min: 0
  max: 100
  min_label: "Strongly Disagree"
  max_label: "Strongly Agree"

Opzioni di visualizzazione del cursore

Mostra il valore corrente:

yaml
- annotation_type: slider
  name: rating
  min: 0
  max: 100
  show_value: true

Casi d'uso comuni

Compito di correzione del testo

yaml
annotation_schemes:
  - annotation_type: radio
    name: has_error
    description: "Does this text contain errors?"
    labels:
      - "Yes"
      - "No"
 
  - annotation_type: text
    name: corrected_text
    description: "Provide the corrected version"
    textarea: true
    show_if:
      scheme: has_error
      value: "Yes"

Qualità della traduzione

yaml
annotation_schemes:
  - annotation_type: slider
    name: adequacy
    description: "How much meaning is preserved?"
    min: 0
    max: 100
    min_label: "None"
    max_label: "All"
 
  - annotation_type: slider
    name: fluency
    description: "How natural does it sound?"
    min: 0
    max: 100
    min_label: "Incomprehensible"
    max_label: "Perfect"
 
  - annotation_type: text
    name: improved_translation
    description: "Suggest a better translation (optional)"
    textarea: true
    required: false

Conteggio di entità

yaml
annotation_schemes:
  - annotation_type: number
    name: person_count
    description: "How many people are mentioned?"
    min: 0
    max: 50
 
  - annotation_type: number
    name: org_count
    description: "How many organizations are mentioned?"
    min: 0
    max: 50
 
  - annotation_type: number
    name: location_count
    description: "How many locations are mentioned?"
    min: 0
    max: 50

Raccolta di feedback

yaml
annotation_schemes:
  - annotation_type: likert
    name: difficulty
    description: "How difficult was this task?"
    size: 5
    min_label: "Very Easy"
    max_label: "Very Hard"
 
  - annotation_type: text
    name: feedback
    description: "Any additional feedback?"
    textarea: true
    required: false
    placeholder: "Share your thoughts..."

Valutazione della qualità con giustificazione

yaml
annotation_schemes:
  - annotation_type: radio
    name: quality
    description: "Rate the quality"
    labels:
      - Excellent
      - Good
      - Fair
      - Poor
 
  - annotation_type: text
    name: justification
    description: "Explain your rating"
    textarea: true
    required: true
    min_length: 20

Validazione

Validazione del testo

yaml
- annotation_type: text
  name: email
  description: "Enter contact email"
  validation:
    pattern: "^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$"
    message: "Please enter a valid email address"

Validazione numerica

I numeri vengono automaticamente validati rispetto a min/max:

yaml
- annotation_type: number
  name: year
  description: "Enter the year"
  min: 1900
  max: 2024
  validation_message: "Year must be between 1900 and 2024"

I campi di testo e numero supportano la navigazione standard da tastiera:

  • Tab per spostarsi tra i campi
  • Enter per inviare (per il testo su una riga)
  • Tasti freccia per l'incremento/decremento dei numeri

Formato di output

Le annotazioni di testo e numero vengono salvate direttamente:

json
{
  "id": "doc1",
  "correction": "The corrected text goes here.",
  "count": 5,
  "confidence": 85
}

Esempio completo: revisione di documenti

yaml
task_name: "Document Review"
 
annotation_schemes:
  # Quality rating
  - annotation_type: likert
    name: quality
    description: "Overall document quality"
    size: 5
    min_label: "Poor"
    max_label: "Excellent"
 
  # Error count
  - annotation_type: number
    name: error_count
    description: "Number of errors found"
    min: 0
    max: 100
    default: 0
 
  # Confidence slider
  - annotation_type: slider
    name: confidence
    description: "How confident are you in this assessment?"
    min: 0
    max: 100
    show_value: true
 
  # Detailed feedback
  - annotation_type: text
    name: errors_found
    description: "List the errors you found"
    textarea: true
    placeholder: "Describe each error..."
 
  # Summary
  - annotation_type: text
    name: summary
    description: "Brief summary of the document"
    max_length: 280
    placeholder: "Summarize in one sentence..."

Buone pratiche

  1. Usa tipi di input appropriati - cursori per valori continui, numeri per conteggi precisi
  2. Imposta vincoli ragionevoli - i valori min/max prevengono dati non validi
  3. Fornisci segnaposto - guida gli annotatori sul formato atteso
  4. Rendi chiari i campi facoltativi - usa required: false e indica nella descrizione
  5. Usa la visualizzazione condizionale - mostra i campi di testo solo quando necessario
  6. Considera la validazione - usa pattern per input strutturati come email o ID