Skip to content

Commit

Permalink
Merge branch 'release-0.4' into GH-232-multi-dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Akbik authored Nov 22, 2018
2 parents 4f96903 + d119332 commit ffa18f8
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 660 deletions.
5 changes: 0 additions & 5 deletions flair/models/sequence_tagger_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ def load_from_file(cls, model_file):
model = model.cuda()
return model

def evaluation_metric(self) -> flair.nn.EvaluationMetric:
if self.tag_type in ['pos', 'upos']:
return flair.nn.EvaluationMetric.ACCURACY
return flair.nn.EvaluationMetric.F1_SCORE

def forward_loss(self, sentences: Union[List[Sentence], Sentence]) -> torch.tensor:
features, lengths, tags = self.forward(sentences)
return self._calculate_loss(features, lengths, tags)
Expand Down
3 changes: 0 additions & 3 deletions flair/models/text_classification_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ def load_from_file(cls, model_file):
model.eval()
return model

def evaluation_metric(self) -> flair.nn.EvaluationMetric:
return flair.nn.EvaluationMetric.F1_SCORE

def forward_loss(self, sentences: Union[List[Sentence], Sentence]) -> torch.tensor:
scores = self.forward(sentences)
return self._calculate_loss(scores, sentences)
Expand Down
5 changes: 0 additions & 5 deletions flair/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ def predict(self, sentences: Union[List[Sentence], Sentence], mini_batch_size=32
sentences."""
pass

@abstractmethod
def evaluation_metric(self) -> EvaluationMetric:
"""Should return a evaluation metric."""
pass


class LockedDropout(torch.nn.Module):
"""
Expand Down
2 changes: 0 additions & 2 deletions flair/trainers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from .sequence_tagger_trainer import SequenceTaggerTrainer
from .text_classification_trainer import TextClassifierTrainer
from .trainer import ModelTrainer
266 changes: 0 additions & 266 deletions flair/trainers/sequence_tagger_trainer.py

This file was deleted.

Loading

0 comments on commit ffa18f8

Please sign in to comment.