Browse Source

[MNT] solve W291,C408 error of flake8 in package

tags/v0.3.2
Gene 1 year ago
parent
commit
4844ece3d5
2 changed files with 2 additions and 3 deletions
  1. +1
    -1
      learnware/specification/regular/image/cnn_gp.py
  2. +1
    -2
      learnware/specification/regular/text/rkme.py

+ 1
- 1
learnware/specification/regular/image/cnn_gp.py View File

@@ -9,7 +9,7 @@ __all__ = ("NNGPKernel", "Conv2d", "ReLU", "Sequential", "ConvKP", "NonlinKP")
"""
With this package, we are able to accurately and efficiently compute the kernel matrix corresponding to the NNGP during the search phase.

Github Repository: https://github.com/cambridge-mlg/cnn-gp
Github Repository: https://github.com/cambridge-mlg/cnn-gp

References: [1] A. Garriga-Alonso, L. Aitchison, and C. E. Rasmussen. Deep Convolutional Networks as shallow Gaussian Processes. In: International Conference on Learning Representations (ICLR'19), 2019.
"""


+ 1
- 2
learnware/specification/regular/text/rkme.py View File

@@ -63,9 +63,8 @@ class RKMETextSpecification(RKMETableSpecification):
def get_language_ids(X):
try:
text = " ".join(X)
lang = langdetect.detect(text)
langs = langdetect.detect_langs(text)
return [l.lang for l in langs]
return [item.lang for item in langs]
except Exception as e:
logger.warning("Language detection failed.")
return []


Loading…
Cancel
Save