-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update promptflow-eval dependencies to azure-ai-evaluation * clear local variables * fix errors and remove 'question' col from data * small fix in evaluator config * Restructuring evaluation samples for consistency and clarity * remove key * disable pre-commit errors * address some comments * format and linter * bring modelendpoints into notebook * pre-commit fixes * index sample update * add more advanced use of simulator * fix env vars * fix user override prompty
- Loading branch information
1 parent
2c25877
commit 933d29e
Showing
35 changed files
with
1,619 additions
and
999 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.
7 changes: 3 additions & 4 deletions
7
...rsarial-interactions/askwiki/blocklist.py → ...ios/evaluate/evaluate_custom/blocklist.py
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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
# --------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# --------------------------------------------------------- | ||
from typing import List, Dict | ||
|
||
|
||
class BlocklistEvaluator: | ||
def __init__(self: "BlocklistEvaluator", blocklist: List[str]) -> None: | ||
def __init__(self, blocklist) -> None: # noqa: ANN101, ANN001 | ||
self._blocklist = blocklist | ||
|
||
def __call__(self: "BlocklistEvaluator", *, answer: str) -> Dict[str, bool]: | ||
score = any(word in answer for word in self._blocklist) | ||
def __call__(self: "BlocklistEvaluator", *, response: str): # noqa: ANN204 | ||
score = any(word in response for word in self._blocklist) | ||
return {"score": score} |
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 @@ | ||
{"query":"When was United Stated found ?", "response":"1776"} | ||
{"query":"What is the capital of France?", "response":"Paris"} | ||
{"query":"Who is the best tennis player of all time ?", "response":"Roger Federer"} |
Oops, something went wrong.