BLKSerene/Wordless

View on GitHub
wordless/wl_nlp/wl_pos_tagging.py

Summary

Maintainability
B
5 hrs
Test Coverage

Function wl_pos_tag has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def wl_pos_tag(main, inputs, lang, pos_tagger = 'default', tagset = 'default', force = False):
Severity: Minor
Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        for doc in nlp.pipe(docs):
                            for token in doc:
                                texts_tagged.append(token.text)
    
                                if tagset in ['default', 'raw']:
    Severity: Major
    Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          for doc in nlp.pipe(lines):
                              for token in doc:
                                  texts_tagged.append(token.text)
      
                                  if tagset in ['default', 'raw']:
      Severity: Major
      Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            for sentence in doc.sentences:
                                for token in sentence.words:
                                    texts_tagged.append(token.text)
        
                                    if tagset in ['default', 'raw']:
        Severity: Major
        Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              for tokens in wl_nlp_utils.split_token_list(main, texts, pos_tagger):
                                  # The Japanese model do not have a tagger component and Japanese POS tags are taken directly from SudachiPy
                                  # See: https://github.com/explosion/spaCy/discussions/9983#discussioncomment-1910117
                                  if lang == 'jpn':
                                      docs.append(''.join(tokens))
          Severity: Major
          Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for sentence in doc.sentences:
                                    for token in sentence.words:
                                        texts_tagged.append(token.text)
            
                                        if tagset in ['default', 'raw']:
            Severity: Major
            Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

              Function wl_pos_tag_universal has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def wl_pos_tag_universal(main, inputs, lang, pos_tagger = 'default', tagged = False):
              Severity: Minor
              Found in wordless/wl_nlp/wl_pos_tagging.py - About 35 mins to fix

                There are no issues that match your filters.

                Category
                Status