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

Output format: training-output to build supervised models #801

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

enoriega
Copy link
Member

@enoriega enoriega commented Sep 6, 2023

Summary

Added a new output format suitable to train classifiers using a python pipeline. It "flattens" activations and regulations and creates a json array with the tokens, spans, label and polarity for each event.

Example

[
  {
    "sentence_tokens" : [ "Notably", ",", "overexpressing", "MafB", "in", "human", "beta-cell", "lines", "(", "beta", "TC3", "cells", ")", "resulted", "in", "increased", "cell", "proliferation", "by", "upregulating", "important", "cell", "cycle", "regulators", ",", "like", "cyclin", "D2", "and", "cyclin", "B", "(", "28", ")", "." ],
    "event_indices" : [ 16, 17, 18, 19, 20, 21, 22, 23 ],
    "type" : "Positive_activation",
    "polarity" : true,
    "controller_indices" : [ 16, 17, 18 ],
    "controlled_indices" : [ 21, 22, 23 ],
    "trigger_indices" : [ 19, 20 ]
  }, {
    "sentence_tokens" : [ "In", "vivo", "glucose", "stimulated", "insulin", "secretion", "(", "GSIS", ")", "experiment", ".." ],
    "event_indices" : [ 2, 3, 4, 5, 6 ],
    "type" : "Positive_activation",
    "polarity" : true,
    "controller_indices" : [ 2, 3 ],
    "controlled_indices" : [ 4, 5, 6 ],
    "trigger_indices" : [ 3, 4 ]
  }
]

Copy link
Member

@kwalcock kwalcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The crossScalaVersion does need to be changed for publication.

@kwalcock
Copy link
Member

@enoriega, this is being built for both Scala 2.11 and 2.12. The earlier version does not like trailing/dangling commas like the ones in TrainingDataExporter, so it doesn't compile. One can use ++compile or ++2.11.12 and then compile to test.

@kwalcock
Copy link
Member

That TrainingDataExporter still needs a comma removed at line 76 in order to work on Scala 2.11.

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

Successfully merging this pull request may close these issues.

None yet

2 participants