Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add system metadata class #575

Open
odashi opened this issue Oct 20, 2022 · 3 comments
Open

Add system metadata class #575

odashi opened this issue Oct 20, 2022 · 3 comments
Assignees

Comments

@odashi
Copy link
Contributor

odashi commented Oct 20, 2022

Processor.process() takes metadata, which is used to directly initialize SysOutputInfo. However, these are essentially different data (especially, "metadata" $\subset$ SysOutputInfo, but not $=$) and the current implementation makes some confusion around this:

The most significant abuse around this behavior is that FileLoaderMetadata is implicitly converted into SysOutputInfo. This shouldn't work unless explicit conversion:

metadata = dataclasses.asdict(data.metadata)
metadata.update(
{
"task_name": TaskType.named_entity_recognition.value,
}
)
processor = get_processor_class(TaskType.named_entity_recognition)()

To this end, we need:

  • A struct defining the system metadata.
  • Change the behavior of Processor to take the system metadata, not a dict.
  • Either:
    • A conversion method between system metadata and FileLoaderReturn/SysOutputInfo
    • Include system metadata as a direct member of FileLoaderReturn/SysOutputInfo
@odashi
Copy link
Contributor Author

odashi commented Oct 20, 2022

RFC: @neubig @pfliu-nlp

@neubig
Copy link
Contributor

neubig commented Oct 20, 2022

Sounds like a good idea, I agree

@pfliu-nlp
Copy link
Collaborator

"The most significant abuse around this behavior is that FileLoaderMetadata is implicitly converted into SysOutputInfo."

Agree. Adding system metadata class sounds nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants