From 8bad75308164cbed814c02d5b825da00c0dcfe6d Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 12:35:08 +0000 Subject: [PATCH] style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf This commit fixes the style issues introduced in 2e40b65 according to the output from Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf. Details: None --- customer_service/natural_language_processing.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/customer_service/natural_language_processing.py b/customer_service/natural_language_processing.py index 07490f49a..6a1aef356 100644 --- a/customer_service/natural_language_processing.py +++ b/customer_service/natural_language_processing.py @@ -1,6 +1,7 @@ import spacy -nlp = spacy.load('en_core_web_sm') +nlp = spacy.load("en_core_web_sm") + class NLP: def __init__(self): @@ -13,14 +14,14 @@ def extract_entities(self, text): def extract_intent(self, text): doc = self.nlp(text) - intents = {'account': False, 'transaction': False, 'other': False} + intents = {"account": False, "transaction": False, "other": False} for token in doc: - if token.text.lower() in ['account', 'accounts']: - intents['account'] = True - elif token.text.lower() in ['transaction', 'transactions']: - intents['transaction'] = True + if token.text.lower() in ["account", "accounts"]: + intents["account"] = True + elif token.text.lower() in ["transaction", "transactions"]: + intents["transaction"] = True if any(intents.values()): return intents else: - intents['other'] = True + intents["other"] = True return intents