Skip to content

Commit

Permalink
style: Black
Browse files Browse the repository at this point in the history
  • Loading branch information
saattrupdan committed Mar 30, 2023
1 parent cece300 commit 2928c50
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/hatespeech/clean_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def clean_text(text: str) -> Union[str, None]:
# Replace 8 digits with " [CVR] " if "cvr" is in the text, else replace with
# " [PHONE] " Check if an 8 digit number is present in text
if re.search(r"(?<!\d)(\d\d ?){4}(?!\d)", text):

# Check if 'cvr' in text
if "cvr" in text.lower():
text = re.sub(r"(?<!\d)(\d\d ?){4}(?!\d)", " [CVR] ", text)
Expand Down
1 change: 0 additions & 1 deletion src/hatespeech/labelling_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def initialise_models():

# Initialise progress bar
with tqdm(desc="Loading models", total=6, leave=False) as pbar:

# Download word tokenizer if not already downloaded
try:
nltk.download("punkt", quiet=True)
Expand Down
1 change: 0 additions & 1 deletion src/hatespeech/prepare_data_for_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def prepare_data_for_annotation(config: DictConfig) -> List[str]:
# resulting dataframe in the annotated directory, and split up the dataframe into a
# validation and test split, and store those too
if config.testing:

# Create test annotated data
labels = [np.random.choice(["Offensive", "Not Offensive"]) for _ in texts]
df_test = pd.DataFrame({"text": texts, "label": labels})
Expand Down

0 comments on commit 2928c50

Please sign in to comment.