-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from parkervg/ingredients-rework
Ingredients rework
- Loading branch information
Showing
36 changed files
with
1,280 additions
and
665 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
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
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
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,5 +1,5 @@ | ||
from .join.main import LLMJoin | ||
from .qa.main import LLMQA | ||
from .map.main import LLMMap | ||
from .join.main import LLMJoin, DEFAULT_JOIN_FEW_SHOT | ||
from .qa.main import LLMQA, DEFAULT_QA_FEW_SHOT | ||
from .map.main import LLMMap, DEFAULT_MAP_FEW_SHOT | ||
from .vqa.main import ImageCaption | ||
from .validate.main import LLMValidate |
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,27 @@ | ||
[ | ||
{ | ||
"join_criteria": "Join to same topics.", | ||
"left_values": ["joshua fields", "bob brown", "ron ryan"], | ||
"right_values": [ | ||
"ron ryan", | ||
"colby mules", | ||
"bob brown (ice hockey)", | ||
"josh fields (pitcher)" | ||
], | ||
"mapping": { | ||
"joshua fields": "josh fields (pitcher)", | ||
"bob brown": "bob brown (ice hockey)", | ||
"ron ryan": "ron ryan" | ||
} | ||
}, | ||
{ | ||
"join_criteria": "Join the fruit to its color", | ||
"left_values": ["banana", "apple", "orange"], | ||
"right_values": ["yellow", "red"], | ||
"mapping": { | ||
"banana": "yellow", | ||
"apple": "red", | ||
"orange": "-" | ||
} | ||
} | ||
] |
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,36 @@ | ||
from attr import attrs, attrib | ||
from typing import List, Dict | ||
|
||
from blendsql.utils import newline_dedent | ||
from blendsql.ingredients.few_shot import Example | ||
|
||
|
||
@attrs(kw_only=True) | ||
class JoinExample(Example): | ||
join_criteria: str = attrib(default="Join to the same topics.") | ||
left_values: List[str] = attrib() | ||
right_values: List[str] = attrib() | ||
|
||
def to_string(self) -> str: | ||
return newline_dedent( | ||
""" | ||
Criteria: {} | ||
Left Values: | ||
{} | ||
Right Values: | ||
{} | ||
Output: | ||
""".format( | ||
self.join_criteria, | ||
"\n".join(self.left_values), | ||
"\n".join(self.right_values), | ||
) | ||
) | ||
|
||
|
||
@attrs(kw_only=True) | ||
class AnnotatedJoinExample(JoinExample): | ||
mapping: Dict[str, str] = attrib() |
Oops, something went wrong.