diff --git a/CHANGELOG.md b/CHANGELOG.md index 20872f1..0f7813b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Bicleaner AI 2.3.2: +### Fixed: +- Fix compatibility with Hardrules metadata dict. + + ## Bicleaner AI 2.3.1: ### Added: - `bicleaner-ai-download` quiet mode. diff --git a/pyproject.toml b/pyproject.toml index 41ba895..fa3ba92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "bicleaner-ai" -version = "2.3.1" +version = "2.3.2" license = {file = "LICENSE"} authors = [ { "name" = "Prompsit Language Engineering", "email" = "info@prompsit.com" } diff --git a/src/bicleaner_ai/classify.py b/src/bicleaner_ai/classify.py index d1c44e1..38bef26 100644 --- a/src/bicleaner_ai/classify.py +++ b/src/bicleaner_ai/classify.py @@ -78,8 +78,8 @@ def load_metadata(args, parser): try: # Load YAML metadata_yaml = yaml.safe_load(metadata_file) - yamlpath = os.path.dirname(os.path.abspath(args.metadata)) - metadata_yaml["yamlpath"] = yamlpath + yamldir = os.path.dirname(os.path.abspath(args.metadata)) + metadata_yaml["yamldir"] = yamldir # Read language pair and tokenizers args.source_lang=metadata_yaml["source_lang"] @@ -96,7 +96,7 @@ def load_metadata(args, parser): logging.info(f"Enabling calibrated output with parameters: {cal_params}") else: cal_params = None - args.clf = get_model(metadata_yaml["classifier_type"])(yamlpath, + args.clf = get_model(metadata_yaml["classifier_type"])(yamldir, metadata_yaml["classifier_settings"]) args.clf.load() @@ -121,7 +121,7 @@ def load_metadata(args, parser): logging.warning("Porn removal not present in metadata, disabling") else: try: - args.porn_removal = fasttext.load_model(os.path.join(yamlpath, metadata_yaml['porn_removal_file'])) + args.porn_removal = fasttext.load_model(os.path.join(yamldir, metadata_yaml['porn_removal_file'])) except: args.porn_removal = fasttext.load_model(args.metadata_yaml['porn_removal_file']) else: