Skip to content

Commit

Permalink
Fix for conversation (CaST 2020)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpiwowar committed Apr 29, 2024
1 parent 8d1f696 commit 889890d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/datamaestro_text/data/conversation/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ class AnswerEntry(Item):
"""The system answer"""


@define
class AnswerDocumentID(Item):
"""An answer as a document ID"""

document_id: str


@define
class RetrievedEntry(Item):
"""List of system-retrieved documents and their relevance"""
Expand All @@ -69,7 +76,7 @@ class RetrievedEntry(Item):
"""List of retrieved documents"""

document_relevances: Optional[List[str]] = None
"""List of retrieved documents and their relevance status"""
"""List of relevance status (optional)"""


@define
Expand Down
4 changes: 2 additions & 2 deletions src/datamaestro_text/datasets/irds/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def iter(self) -> Iterator[TopicRecord]:
from datamaestro_text.data.conversation.base import (
ConversationTreeNode,
DecontextualizedDictItem,
RetrievedEntry,
AnswerDocumentID,
ConversationHistoryItem,
EntryType,
)
Expand Down Expand Up @@ -473,7 +473,7 @@ def records(self):
node = node.add(
ConversationTreeNode(
Record(
RetrievedEntry(query.manual_canonical_result_id),
AnswerDocumentID(query.manual_canonical_result_id),
EntryType.SYSTEM_ANSWER,
)
)
Expand Down

0 comments on commit 889890d

Please # to comment.