def METHOD_NAME(self, inputs, lengths, labels=None):
    word_embed = self.word_embedding(inputs)
    bigru_output, _ = self.gru(word_embed, sequence_length=lengths)
    emission = self.fc(bigru_output)
    if labels is not None:
        loss = self.crf_loss(emission, lengths, labels)
        return loss
    else:
        _, prediction = self.viterbi_decoder(emission, lengths)
        return prediction