def _read_nlp_conf()

in presidio-analyzer/presidio_analyzer/nlp_engine/nlp_engine_provider.py [0:0]


    def _read_nlp_conf(conf_file: Union[Path, str]) -> dict:
        """Read the nlp configuration from a provided yaml file."""

        if not Path(conf_file).exists():
            nlp_configuration = {
                "nlp_engine_name": "spacy",
                "models": [{"lang_code": "en", "model_name": "en_core_web_lg"}],
            }
            logger.warning(
                f"configuration file {conf_file} not found.  "
                f"Using default config: {nlp_configuration}."
            )

        else:
            nlp_configuration = yaml.safe_load(open(conf_file))

        return nlp_configuration