INNER CODE UNIT · Python

check

R1j1t/contextualSpellCheck · contextualSpellCheck/contextualSpellCheck.py:181

    def check(self, query="", spacy_model="en_core_web_sm"):
        """
        Complete pipeline for **testing purpose only**

        Keyword Args:
            query (str): query for which spell check model to run
                            (default: {""})
            spacy_model (str): Name of spacy model

        Returns:
            (str, `Doc`): returns updated query (if no oov words then "")
                          and updated Doc Object
        """
        if not isinstance(query, str) and len(query) == 0:
            return "Invalid query, expected non empty `str` but passed", query

        nlp = spacy.load(spacy_model, disable=["tagger", "parser"])
        doc = nlp(query)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…