-
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 c7a9e2e
Showing
45 changed files
with
525 additions
and
23 deletions.
There are no files selected for viewing
Binary file not shown.
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,3 @@ | ||
name: testpipeline | ||
services: {} | ||
version: '3.8' |
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 @@ | ||
foo: bar |
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.
1 change: 1 addition & 0 deletions
1
data/creative_commons_pipline/cache/1c3f24802e87ed0d7c46242e1f9dbc2f.txt
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 @@ | ||
/data/creative_commons_pipline/creative_commons_pipline-20231206224045/filter_languages/manifest.json |
1 change: 1 addition & 0 deletions
1
data/creative_commons_pipline/cache/6d120fd3dd8ec8f882b7a3c91d112b9c.txt
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 @@ | ||
/data/creative_commons_pipline/creative_commons_pipline-20231206224045/download_images/manifest.json |
1 change: 1 addition & 0 deletions
1
data/creative_commons_pipline/cache/f566da7d30e5bc64cec6144cc2a57c27.txt
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 @@ | ||
/data/creative_commons_pipline/creative_commons_pipline-20231206224045/load_from_hub/manifest.json |
46 changes: 46 additions & 0 deletions
46
...ive_commons_pipline/creative_commons_pipline-20231206223031/download_images/manifest.json
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,46 @@ | ||
{ | ||
"metadata": { | ||
"base_path": "/data", | ||
"pipeline_name": "creative_commons_pipline", | ||
"run_id": "creative_commons_pipline-20231206223031", | ||
"component_id": "download_images", | ||
"cache_key": "f566da7d30e5bc64cec6144cc2a57c27" | ||
}, | ||
"index": { | ||
"location": "/creative_commons_pipline-20231206223031/download_images" | ||
}, | ||
"fields": { | ||
"alt_text": { | ||
"location": "/creative_commons_pipline-20231206223031/load_from_hub", | ||
"type": "string" | ||
}, | ||
"image_url": { | ||
"location": "/creative_commons_pipline-20231206223031/load_from_hub", | ||
"type": "string" | ||
}, | ||
"license_location": { | ||
"location": "/creative_commons_pipline-20231206223031/load_from_hub", | ||
"type": "string" | ||
}, | ||
"license_type": { | ||
"location": "/creative_commons_pipline-20231206223031/load_from_hub", | ||
"type": "string" | ||
}, | ||
"webpage_url": { | ||
"location": "/creative_commons_pipline-20231206223031/load_from_hub", | ||
"type": "string" | ||
}, | ||
"image": { | ||
"location": "/creative_commons_pipline-20231206223031/download_images", | ||
"type": "binary" | ||
}, | ||
"image_width": { | ||
"location": "/creative_commons_pipline-20231206223031/download_images", | ||
"type": "int32" | ||
}, | ||
"image_height": { | ||
"location": "/creative_commons_pipline-20231206223031/download_images", | ||
"type": "int32" | ||
} | ||
} | ||
} |
Binary file added
BIN
+169 KB
...ve_commons_pipline/creative_commons_pipline-20231206223031/download_images/part.0.parquet
Binary file not shown.
Binary file added
BIN
+359 KB
...ve_commons_pipline/creative_commons_pipline-20231206223031/download_images/part.1.parquet
Binary file not shown.
Binary file added
BIN
+199 KB
...ve_commons_pipline/creative_commons_pipline-20231206223031/download_images/part.2.parquet
Binary file not shown.
Binary file added
BIN
+2.72 KB
...ve_commons_pipline/creative_commons_pipline-20231206223031/download_images/part.3.parquet
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...ve_commons_pipline/creative_commons_pipline-20231206223031/filter_languages/manifest.json
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 @@ | ||
{"metadata": {"base_path": "/data", "pipeline_name": "creative_commons_pipline", "run_id": "creative_commons_pipline-20231206223031", "component_id": "filter_languages", "cache_key": "f566da7d30e5bc64cec6144cc2a57c27"}, "index": {"location": "/creative_commons_pipline-20231206223031/filter_languages"}, "fields": {"alt_text": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "image_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_location": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_type": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "webpage_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "image": {"location": "/creative_commons_pipline-20231206223031/download_images", "type": "binary"}, "image_width": {"location": "/creative_commons_pipline-20231206223031/download_images", "type": "int32"}, "image_height": {"location": "/creative_commons_pipline-20231206223031/download_images", "type": "int32"}}} |
Binary file added
BIN
+1.24 KB
...e_commons_pipline/creative_commons_pipline-20231206223031/filter_languages/part.0.parquet
Binary file not shown.
Binary file added
BIN
+1.37 KB
...e_commons_pipline/creative_commons_pipline-20231206223031/filter_languages/part.1.parquet
Binary file not shown.
Binary file added
BIN
+1.44 KB
...e_commons_pipline/creative_commons_pipline-20231206223031/filter_languages/part.2.parquet
Binary file not shown.
Binary file added
BIN
+1.4 KB
...e_commons_pipline/creative_commons_pipline-20231206223031/filter_languages/part.3.parquet
Binary file not shown.
Binary file added
BIN
+1.24 KB
...e_commons_pipline/creative_commons_pipline-20231206223031/filter_languages/part.4.parquet
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...ative_commons_pipline/creative_commons_pipline-20231206223031/load_from_hub/manifest.json
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 @@ | ||
{"metadata": {"base_path": "/data", "pipeline_name": "creative_commons_pipline", "run_id": "creative_commons_pipline-20231206223031", "component_id": "load_from_hub", "cache_key": "f566da7d30e5bc64cec6144cc2a57c27"}, "index": {"location": "/creative_commons_pipline-20231206223031/load_from_hub"}, "fields": {"alt_text": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "image_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_location": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_type": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "webpage_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}}} |
Binary file added
BIN
+33 KB
...tive_commons_pipline/creative_commons_pipline-20231206223031/load_from_hub/part.0.parquet
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...ive_commons_pipline/creative_commons_pipline-20231206224045/download_images/manifest.json
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 @@ | ||
{"metadata": {"base_path": "/data", "pipeline_name": "creative_commons_pipline", "run_id": "creative_commons_pipline-20231206223031", "component_id": "download_images", "cache_key": "f566da7d30e5bc64cec6144cc2a57c27"}, "index": {"location": "/creative_commons_pipline-20231206223031/download_images"}, "fields": {"alt_text": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "image_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_location": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_type": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "webpage_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "image": {"location": "/creative_commons_pipline-20231206223031/download_images", "type": "binary"}, "image_width": {"location": "/creative_commons_pipline-20231206223031/download_images", "type": "int32"}, "image_height": {"location": "/creative_commons_pipline-20231206223031/download_images", "type": "int32"}}} |
1 change: 1 addition & 0 deletions
1
...ve_commons_pipline/creative_commons_pipline-20231206224045/filter_languages/manifest.json
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 @@ | ||
{"metadata": {"base_path": "/data", "pipeline_name": "creative_commons_pipline", "run_id": "creative_commons_pipline-20231206224045", "component_id": "filter_languages", "cache_key": "f566da7d30e5bc64cec6144cc2a57c27"}, "index": {"location": "/creative_commons_pipline-20231206224045/filter_languages"}, "fields": {"alt_text": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "image_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_location": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_type": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "webpage_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "image": {"location": "/creative_commons_pipline-20231206223031/download_images", "type": "binary"}, "image_width": {"location": "/creative_commons_pipline-20231206223031/download_images", "type": "int32"}, "image_height": {"location": "/creative_commons_pipline-20231206223031/download_images", "type": "int32"}}} |
Binary file added
BIN
+1.24 KB
...e_commons_pipline/creative_commons_pipline-20231206224045/filter_languages/part.0.parquet
Binary file not shown.
Binary file added
BIN
+1.37 KB
...e_commons_pipline/creative_commons_pipline-20231206224045/filter_languages/part.1.parquet
Binary file not shown.
Binary file added
BIN
+1.44 KB
...e_commons_pipline/creative_commons_pipline-20231206224045/filter_languages/part.2.parquet
Binary file not shown.
Binary file added
BIN
+1.4 KB
...e_commons_pipline/creative_commons_pipline-20231206224045/filter_languages/part.3.parquet
Binary file not shown.
Binary file added
BIN
+1.24 KB
...e_commons_pipline/creative_commons_pipline-20231206224045/filter_languages/part.4.parquet
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...ative_commons_pipline/creative_commons_pipline-20231206224045/load_from_hub/manifest.json
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 @@ | ||
{"metadata": {"base_path": "/data", "pipeline_name": "creative_commons_pipline", "run_id": "creative_commons_pipline-20231206223031", "component_id": "load_from_hub", "cache_key": "f566da7d30e5bc64cec6144cc2a57c27"}, "index": {"location": "/creative_commons_pipline-20231206223031/load_from_hub"}, "fields": {"alt_text": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "image_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_location": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "license_type": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}, "webpage_url": {"location": "/creative_commons_pipline-20231206223031/load_from_hub", "type": "string"}}} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.