Zacznij terazZacznij za darmo

Transfer learning z uczeniem jednoprzykładowym

Transfer learning ma wiele odmian – jedną z nich jest uczenie jednoprzykładowe (one-shot learning), w którym model jest trenowany na podstawie pojedynczego przykładu.

Przygotuj przykład uczenia jednoprzykładowego dla modelu.

To ćwiczenie jest częścią kursu

Wprowadzenie do LLM w Pythonie

Zobacz kurs

Instrukcje do ćwiczenia

  • Uzupełnij przykład uczenia jednoprzykładowego, wskazując, że przykładowa recenzja ma wydźwięk Positive.

Interaktywne ćwiczenie praktyczne

Spróbuj tego ćwiczenia, uzupełniając ten przykładowy kod.

# Include an example in the input ext
input_text = """
Text: "The dinner we had was great and the service too."
Classify the sentiment of this sentence as either positive or negative.
Example:
Text: "The food was delicious"
____
Text: "The dinner we had was great and the service too."
Sentiment:
"""

# Apply the example to the model
result = model(____, max_length=100)

print(result[0]["label"])
Edytuj i uruchom kod