-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update evaluate ragas component as reusable component
- Loading branch information
1 parent
08fd581
commit 95c28ea
Showing
9 changed files
with
87 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# retriever_eval_ragas | ||
|
||
### Description | ||
Component that evaluates the retriever using RAGAS | ||
|
||
### Inputs / outputs | ||
|
||
**This component consumes:** | ||
|
||
- text: string | ||
- retrieved_chunks: list<item: string> | ||
|
||
**This component produces no data.** | ||
|
||
### Arguments | ||
|
||
The component takes the following arguments to alter its behavior: | ||
|
||
| argument | type | description | default | | ||
| -------- | ---- | ----------- | ------- | | ||
| module | str | Module from which the LLM is imported. Defaults to langchain.llms | langchain.llms | | ||
| llm_name | str | Name of the selected llm | / | | ||
| llm_kwargs | dict | Arguments of the selected llm | / | | ||
| metrics | list | RAGAS metrics to compute | / | | ||
|
||
### Usage | ||
|
||
You can add this component to your pipeline using the following code: | ||
|
||
```python | ||
from fondant.pipeline import Pipeline | ||
|
||
|
||
pipeline = Pipeline(...) | ||
|
||
dataset = pipeline.read(...) | ||
|
||
dataset = dataset.apply( | ||
"evaluate_ragas", | ||
arguments={ | ||
# Add arguments | ||
# "module": "langchain.llms", | ||
# "llm_name": , | ||
# "llm_kwargs": {}, | ||
# "metrics": [], | ||
} | ||
) | ||
``` | ||
|
||
### Testing | ||
|
||
You can run the tests using docker with BuildKit. From this directory, run: | ||
``` | ||
docker build . --target test | ||
``` |
16 changes: 7 additions & 9 deletions
16
...triever_eval_ragas/fondant_component.yaml → ...nts/evaluate_ragas/fondant_component.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ragas==0.0.21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.