[AI Embedchain] API手册 Evaluate

evaluate() 方法用于评估RAG应用的性能。您可以在下面找到签名:

使用方法

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from embedchain import App

app = App()

# add data source
app.add("https://www.forbes.com/profile/elon-musk")

# run evaluation
app.evaluate("what is the net worth of Elon Musk?")
# {'answer_relevancy': 0.958019958036268, 'context_relevancy': 0.12903225806451613}

# or
# app.evaluate(["what is the net worth of Elon Musk?", "which companies does Elon Musk own?"])