Skip to content

Commit

Permalink
Chore: Add kwargs to docs (#1365)
Browse files Browse the repository at this point in the history
* chore: add kwargs to objects docs
  • Loading branch information
scottire authored Mar 26, 2024
1 parent 50611c0 commit c9be0a7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/docs/guides/core-types/datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ from weave import Dataset
weave.init('intro-example')

# Create a dataset
dataset = Dataset([
dataset = Dataset(name='grammar', rows=[
{'id': '0', 'sentence': "He no likes ice cream.", 'correction': "He doesn't like ice cream."},
{'id': '1', 'sentence': "She goed to the store.", 'correction': "She went to the store."},
{'id': '2', 'sentence': "They plays video games all day.", 'correction': "They play video games all day."}
])

# Publish the dataset
weave.publish(dataset, 'grammar')
weave.publish(dataset)

# Retrieve the dataset
dataset_ref = weave.ref('grammar').get()
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/core-types/evaluations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Evaluation-driven development helps you reliably iterate on an application. The
from weave import Evaluation

evaluation = Evaluation(
dataset, scores=[score]
dataset=dataset, scorers=[score]
)
evaluation.evaluate(model)
```
Expand All @@ -28,4 +28,4 @@ Then, define a list of scoring functions. Each function should take an example a

Finally, create a model and pass this to `evaluation.evaluate`, which will run `predict` on each example and score the output with each scoring function.

To see this in action, follow the '[Build an Evaluation pipeline](/tutorial-eval)' tutorial.
To see this in action, follow the '[Build an Evaluation pipeline](/tutorial-eval)' tutorial.
4 changes: 2 additions & 2 deletions docs/docs/guides/core-types/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You can call the model as usual with:
import weave
weave.init('project-name')

model = YourModel('hello', 5)
model = YourModel(attribute1='hello', attribute2=5)
model.predict('world')
```

Expand All @@ -48,7 +48,7 @@ For example, here we create a new model:
import weave
weave.init('project-name')

model = YourModel('howdy', 10)
model = YourModel(attribute1='howdy', attribute2=10)
model.predict('world')
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorial-eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def fruit_name_score(target: dict, prediction: dict) -> dict:
# highlight-next-line
evaluation = evaluate.Evaluation(
# highlight-next-line
dataset, scores=[MulticlassF1Score(class_names=["fruit", "color", "flavor"]), fruit_name_score],
dataset=dataset, scorers=[MulticlassF1Score(class_names=["fruit", "color", "flavor"]), fruit_name_score],
# highlight-next-line
)
# highlight-next-line
Expand Down

0 comments on commit c9be0a7

Please sign in to comment.