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

Implements entity pre-training #178

Merged
merged 1 commit into from Sep 10, 2019
Merged

Conversation

JohnGiorgi
Copy link
Contributor

Overview

This PR implements entity pre-training. Simply put, entity pre-training involves pre-training the entity module before training the entire NER + RE model jointly.

Previously, we were implementing this by delaying the training of the RE module by a full epoch. I have found a different yet equally simple technique that works quite well. Basically, the loss function is weighted according to

loss = ner_loss + decay_coef * re_loss

where 0 <= delay_coef <= 1 and is computed as current_step / total_steps if this is the first epoch, or 1 otherwise. I saw gains up to 1% on the validation set using this scheme.

@JohnGiorgi JohnGiorgi self-assigned this Sep 9, 2019
@coveralls
Copy link

coveralls commented Sep 9, 2019

Pull Request Test Coverage Report for Build 502

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.007%) to 88.091%

Files with Coverage Reduction New Missed Lines %
saber/models/modules/bert_for_entity_and_relation_extraction.py 2 95.15%
Totals Coverage Status
Change from base Build 500: 0.007%
Covered Lines: 1435
Relevant Lines: 1629

💛 - Coveralls

@JohnGiorgi JohnGiorgi merged commit f73d6b8 into development Sep 10, 2019
@JohnGiorgi JohnGiorgi deleted the entity-pretraining branch September 10, 2019 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants