Removes support for Python 3.8 and lower from the code base

This commit is contained in:
Trenton Holmes
2023-09-09 09:08:55 -07:00
committed by Trenton H
parent c8bfbb9315
commit 650c816a7b
34 changed files with 195 additions and 337 deletions

View File

@@ -3,11 +3,10 @@ import os
import pickle
import re
import warnings
from collections.abc import Iterator
from datetime import datetime
from hashlib import sha256
from pathlib import Path
from typing import Iterator
from typing import List
from typing import Optional
from django.conf import settings
@@ -357,7 +356,7 @@ class DocumentClassifier:
# Tokenize
# This splits the content into tokens, roughly words
words: List[str] = word_tokenize(
words: list[str] = word_tokenize(
content,
language=settings.NLTK_LANGUAGE,
)
@@ -404,7 +403,7 @@ class DocumentClassifier:
else:
return None
def predict_tags(self, content: str) -> List[int]:
def predict_tags(self, content: str) -> list[int]:
from sklearn.utils.multiclass import type_of_target
if self.tags_classifier: