BaşlayınÜcretsiz Başlayın

Cypher few-shot istemi oluşturma

Oluşturulan Cypher'ın güvenilirliğini artırmak için kullanacağın son teknik, bir few-shot istem sağlamaktır. Few-shot istemler, modeli büyük bir örnek veri kümesiyle ince ayar yapmana gerek kalmadan istenen çıktıya yönlendirmenin harika bir yoludur.

Bu kullanım senaryosuna özel olarak hazırlanmış bir örnek seti examples olarak mevcut; içeriğini görmek için kabukta yazdırmaktan çekinme. Bunları, Cypher üretim süreci için bir few-shot istem oluşturmakta kullanacaksın. Daha önce oluşturduğun grafik hâlâ graph olarak kullanılabilir.

Bu egzersiz

LangChain ile Retrieval Augmented Generation (RAG)

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create an example prompt template
example_prompt = ____(
    "User input: {question}\nCypher query: {query}"
)

# Create the few-shot prompt template
cypher_prompt = ____(
    examples=____,
    example_prompt=____,
    prefix="You are a Neo4j expert. Given an input question, create a syntactically correct Cypher query to run.\n\nHere is the schema information\n{schema}.\n\nBelow are a number of examples of questions and their corresponding Cypher queries.",
    suffix="User input: {question}\nCypher query: ",
    input_variables=["____"]
)
Kodu Düzenle ve Çalıştır