Preparing report...

Report for github.com/sugarme/transformer

A+    Excellent!    Found 17 issues across 41 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo100%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

No problems detected. Good job!


golint58%

Golint is a linter for Go source code.

    • transformer/bert/model.go
    • Line 174: warning: comment on exported function NewBertPredictionHeadTransform should be of the form "NewBertPredictionHeadTransform ..." (golint)
    • Line 520: warning: comment on exported method BertForTokenClassification.ForwardT should be of the form "ForwardT ..." (golint)
    • Line 570: warning: comment on exported function NewForBertQuestionAnswering should be of the form "NewForBertQuestionAnswering ..." (golint)
    • transformer/bert/opt.go
    • Line 10: warning: exported function MaskTensorOpt should have comment or be unexported (golint)
    • Line 16: warning: exported function EncoderMaskTensorOpt should have comment or be unexported (golint)
    • Line 22: warning: exported function EncoderHiddenStateTensorOpt should have comment or be unexported (golint)
    • transformer/pipeline/common.go
    • Line 25: warning: exported const Bert should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported type ModelOption should have comment or be unexported (golint)
    • Line 39: warning: exported type Config should have comment or be unexported (golint)
    • Line 47: warning: exported function NewBertConfigOption should have comment or be unexported (golint)
    • Line 54: warning: exported type TokenizerType should have comment or be unexported (golint)
    • Line 57: warning: exported const BertTokenizer should have comment (or a comment on this block) or be unexported (golint)
    • Line 96: warning: comment on exported method ConfigOption.GetLabelMapping should be of the form "GetLabelMapping ..." (golint)
    • Line 114: warning: comment on exported function TokenizerOptionFromFile should be of the form "TokenizerOptionFromFile ..." (golint)
    • transformer/util/activation.go
    • Line 17: warning: exported type ReluActivation should have comment or be unexported (golint)
    • Line 21: warning: exported var Relu should have comment or be unexported (golint)
    • Line 23: warning: exported function NewRelu should have comment or be unexported (golint)
    • Line 27: warning: exported method ReluActivation.Fwd should have comment or be unexported (golint)
    • Line 31: warning: exported method ReluActivation.Name should have comment or be unexported (golint)
    • Line 38: warning: exported type GeluActivation should have comment or be unexported (golint)
    • Line 42: warning: exported var Gelu should have comment or be unexported (golint)
    • Line 44: warning: exported function NewGelu should have comment or be unexported (golint)
    • Line 48: warning: exported method GeluActivation.Fwd should have comment or be unexported (golint)
    • Line 52: warning: exported method GeluActivation.Name should have comment or be unexported (golint)
    • Line 59: warning: exported type TanhActivation should have comment or be unexported (golint)
    • Line 63: warning: exported var Tanh should have comment or be unexported (golint)
    • Line 65: warning: exported function NewTanh should have comment or be unexported (golint)
    • Line 69: warning: exported method TanhActivation.Fwd should have comment or be unexported (golint)
    • Line 73: warning: exported method TanhActivation.Name should have comment or be unexported (golint)
    • Line 80: warning: exported type SwishActivation should have comment or be unexported (golint)
    • Line 84: warning: exported var Swish should have comment or be unexported (golint)
    • Line 86: warning: exported function NewSwish should have comment or be unexported (golint)
    • Line 90: warning: exported method SwishActivation.Fwd should have comment or be unexported (golint)
    • Line 94: warning: exported method SwishActivation.Name should have comment or be unexported (golint)
    • Line 101: warning: exported type MishActivation should have comment or be unexported (golint)
    • Line 105: warning: exported var Mish should have comment or be unexported (golint)
    • Line 107: warning: exported function NewMish should have comment or be unexported (golint)
    • Line 111: warning: exported method MishActivation.Fwd should have comment or be unexported (golint)
    • Line 119: warning: exported method MishActivation.Name should have comment or be unexported (golint)
    • Line 129: warning: exported var ActivationFnMap should have comment or be unexported (golint)
    • transformer/bert/attention.go
    • Line 18: warning: exported type BertSelfAttention should have comment or be unexported (golint)
    • Line 120: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 129: warning: exported type BertSelfOutput should have comment or be unexported (golint)
    • Line 135: warning: exported function NewBertSelfOutput should have comment or be unexported (golint)
    • Line 150: warning: exported method BertSelfOutput.ForwardT should have comment or be unexported (golint)
    • Line 167: warning: exported type BertAttention should have comment or be unexported (golint)
    • Line 172: warning: exported function NewBertAttention should have comment or be unexported (golint)
    • Line 179: warning: exported method BertAttention.ForwardT should have comment or be unexported (golint)
    • Line 190: warning: exported type BertIntermediate should have comment or be unexported (golint)
    • Line 195: warning: exported function NewBertIntermediate should have comment or be unexported (golint)
    • Line 207: warning: exported method BertIntermediate.Forward should have comment or be unexported (golint)
    • Line 220: warning: exported type BertOutput should have comment or be unexported (golint)
    • Line 226: warning: exported function NewBertOutput should have comment or be unexported (golint)
    • Line 240: warning: exported method BertOutput.ForwardT should have comment or be unexported (golint)
    • transformer/bert/config.go
    • Line 38: warning: comment on exported function NewConfig should be of the form "NewConfig ..." (golint)
    • Line 70: warning: exported function ConfigFromFile should have comment or be unexported (golint)
    • Line 152: warning: exported method BertConfig.GetVocabSize should have comment or be unexported (golint)
    • transformer/bert/embedding.go
    • Line 18: warning: exported type BertEmbeddings should have comment or be unexported (golint)
    • Line 63: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • transformer/bert/tokenizer.go
    • Line 16: warning: exported type BertTokenizerFast should have comment or be unexported (golint)
    • Line 26: warning: exported type Tokenizer should have comment or be unexported (golint)
    • Line 30: warning: exported function NewTokenizer should have comment or be unexported (golint)
    • Line 35: warning: exported method Tokenizer.Load should have comment or be unexported (golint)
    • transformer/util/file-util.go
    • Line 14: warning: exported const WeightName should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported var DefaultCachePath should have comment or be unexported (golint)
    • Line 97: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • transformer/util/linear.go
    • Line 8: warning: exported type LinearNoBiasConfig should have comment or be unexported (golint)
    • Line 12: warning: exported function DefaultLinearNoBiasConfig should have comment or be unexported (golint)
    • Line 19: warning: exported type LinearNoBias should have comment or be unexported (golint)
    • Line 23: warning: exported function NewLinearNoBias should have comment or be unexported (golint)
    • transformer/roberta/model.go
    • Line 1: warning: package comment should be of the form "Package roberta ..." (golint)
    • Line 44: warning: comment on exported method RobertaLMHead.Forward should be of the form "Forward ..." (golint)
    • Line 112: warning: comment on exported method RobertaForMaskedLM.Forward should be of the form "Forward ..." (golint)
    • Line 156: warning: comment on exported type RobertaClassificationHead should be of the form "RobertaClassificationHead ..." (with optional leading article) (golint)
    • Line 243: warning: comment on exported method RobertaForSequenceClassification.ForwardT should be of the form "ForwardT ..." (golint)
    • Line 436: warning: comment on exported function NewRobertaForQuestionAnswering should be of the form "NewRobertaForQuestionAnswering ..." (golint)
    • Line 484: warning: comment on exported method RobertaForQuestionAnswering.ForwardT should be of the form "ForwardT ..." (golint)
    • transformer/util/dropout.go
    • Line 7: warning: exported type Dropout should have comment or be unexported (golint)
    • Line 11: warning: exported function NewDropout should have comment or be unexported (golint)
    • Line 17: warning: exported method Dropout.ForwardT should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell92%

Misspell Finds commonly misspelled English words