pixano.features.schemas.annotations.text_generation
Message(created_at=None, updated_at=None, **data)
Bases: Annotation
Textual exchange in a question/answer conversation for image or text description and information extraction.
Attributes:
Name | Type | Description |
---|---|---|
number |
int
|
message number to associate different ANSWER messages to a QUESTION. |
user |
str
|
identify who is the author of the message (eg a human, a model, the ground truth, etc). |
content |
str
|
actual text of the message. |
timestamp |
datetime
|
creation date of the message. |
type |
str
|
type of the message within "SYSTEM", "QUESTION" or"ANSWER". - SYSTEM: used for prefix messages stating the context. No associated answer expected - QUESTION: used to ask a question about a View. Expecting at least one answer (same message number) - ANSWER: used to reply to a question message by refering its message number |
Source code in pixano/features/schemas/base_schema.py
none()
classmethod
Utility function to get a None equivalent. Should be removed when Lance could manage None value.
Returns:
Type | Description |
---|---|
Message
|
"None" Message. |
Source code in pixano/features/schemas/annotations/text_generation.py
create_message(number, user, type, content, timestamp=datetime(1, 1, 1, 0, 0, 0, 0), id='', item_ref=ItemRef.none(), view_ref=ViewRef.none(), entity_ref=EntityRef.none(), source_ref=SourceRef.none())
Create a Message instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
number
|
int
|
message number to associate diffrent ANSWER messages to a QUESTION |
required |
user
|
str
|
identify who is the author of the message (eg a human, a model, the ground truth, etc) |
required |
type
|
Literal['SYSTEM', 'QUESTION', 'ANSWER']
|
type of the message within "SYSTEM", "QUESTION" or"ANSWER" |
required |
content
|
str
|
actual text of the message |
required |
timestamp
|
datetime
|
creation date of the message |
datetime(1, 1, 1, 0, 0, 0, 0)
|
id
|
str
|
object id |
''
|
item_ref
|
ItemRef
|
Item reference. |
none()
|
view_ref
|
ViewRef
|
View reference. |
none()
|
entity_ref
|
EntityRef
|
Entity reference. |
none()
|
source_ref
|
SourceRef
|
Source reference. |
none()
|
Returns:
Type | Description |
---|---|
Message
|
The created |