Skip to content

Commit

Permalink
style: format code with Autopep8, Black, ClangFormat, dotnet-format, …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
deepsource-autofix[bot] authored May 10, 2024
1 parent 896f93f commit 8bad753
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions customer_service/natural_language_processing.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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

0 comments on commit 8bad753

Please sign in to comment.