kiwi.systems.outputs.quality_estimation
WordLevelConfig
Base class for all pydantic configs. Used to configure base behaviour of configs.
SentenceLevelConfig
QEOutputs
Base class for all neural network modules.
tag_metrics(*targets, prefix=None, labels=None)
tag_metrics
kiwi.systems.outputs.quality_estimation.
logger
Bases: kiwi.utils.io.BaseConfig
kiwi.utils.io.BaseConfig
target
Train or predict target tags
gaps
Train or predict gap tags
source
Train or predict source tags
class_weights
Relative weight for labels on each output side.
hter
Predict Sentence Level Scores. Requires the appropriate input files (usually with HTER).
use_distribution
Use probabilistic Loss for sentence scores instead of squared error. If set (requires hter to also be set), the model will output mean and variance of a truncated Gaussian distribution over the interval [0, 1], and use the NLL of ground truth scores as the loss. This seems to improve performance, and gives you uncertainty estimates for sentence level predictions as a byproduct.
binary
Predict Binary Label for each sentence, indicating hter == 0.0. Requires the appropriate input files (usually with HTER).
Bases: kiwi.systems._meta_module.MetaModule
kiwi.systems._meta_module.MetaModule
Your models should also subclass this class.
Modules can also contain other Modules, allowing to nest them in a tree structure. You can assign the submodules as regular attributes:
import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super(Model, self).__init__() self.conv1 = nn.Conv2d(1, 20, 5) self.conv2 = nn.Conv2d(20, 20, 5) def forward(self, x): x = F.relu(self.conv1(x)) return F.relu(self.conv2(x))
Submodules assigned in this way will be registered, and will have their parameters converted too when you call to(), etc.
to()
Config
word_level
sentence_level
sentence_loss_weight
Multiplier for sentence_level loss weight.
dropout
last_activation
n_layers_output
forward
loss
word_losses
Compute sequence tagging loss.
sentence_losses
Compute sentence score loss.
metrics_step
metrics_end
metrics
labels
decode_outputs
decode_word_outputs
decode_sentence_outputs
kiwi.systems.outputs
kiwi.systems.outputs.translation_language_model