Skip to content
Snippets Groups Projects
Commit 5e0d07a8 authored by Michał Pogoda's avatar Michał Pogoda
Browse files

style: sorting & cleaining imports

parent cd864a63
No related branches found
No related tags found
1 merge request!10Anonimizer v2
Pipeline #9326 passed
Showing
with 56 additions and 34 deletions
from src.worker import Worker
import argparse
from src.worker import Worker
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="anonymizer")
parser.add_argument("input_path", type=str, help="Path to the input file")
......
"""Implementation of anonymizer service."""
import nlp_ws
from src.worker import Worker
import logging
import nlp_ws
from src.worker import Worker
_log = logging.getLogger(__name__)
......
import json
import hydra
from omegaconf import OmegaConf
import json
@hydra.main(config_path="config", config_name="config")
......
"""Implementation of anonymizer service."""
import argparse
from src.anonymizers.polish_anonymizer import PolishAnonymizer
from src.anonymizers.english_anonymizer import EnglishAnonymizer
from src.anonymizers.polish_anonymizer import PolishAnonymizer
from src.anonymizers.russian_anonymizer import RussianAnonymizer
......
from lpmn_client_biz import Connection, IOType, upload, download, Task, delete
import json
from lpmn_client_biz import Connection, IOType, Task, delete, download, upload
lpmn = [
"morphodita",
{"posconverter": {"input_fromat": "ccl", "output_fromat": "json"}},
......
from src.detections.detection import *
from src.detections.date import *
from src.detections.detection import *
from src.utils.subclasses import get_sublcasses
DETECTION_CLASSES_MAP = {
......
from typing import List, Optional, Tuple
from src.detections.detection import Detection
from typing import List, Tuple, Optional
class DateDetection(Detection):
......
from typing import Optional
from dataclasses import dataclass
from typing import Optional
@dataclass
......
from typing import List, Dict, Any, Tuple
from typing import Any, Dict, List, Tuple
from src.detections import DateDetection, Detection
from src.detectors.interface import Detector
from .en import detect_dates_en
from .pl import detect_dates_pl
from .ru import detect_dates_ru
from src.detections import Detection, DateDetection
from src.detectors.interface import Detector
class DateDetector(Detector):
......
import regex as re
from typing import List, Tuple
from src.detections import DateDetection
import regex as re
from src.detections import DateDetection
from src.detectors.date.utils import parse_date_to_format
EN_DATES_REGEX = re.compile(
......
import regex as re
from typing import List, Tuple
from src.detections import DateDetection
from src.suppressors.order_based import OrderBasedSuppressor
import regex as re
from src.detections import DateDetection
from src.detectors.date.utils import parse_date_to_format
from src.suppressors.order_based import OrderBasedSuppressor
PL_DATES_REGEX = re.compile(
r"\b(?P<day_or_month_year>"
......
import regex as re
from typing import List, Tuple
from src.detections import DateDetection
import regex as re
from src.detections import DateDetection
from src.detectors.date.utils import parse_date_to_format
RU_DATES_REGEX = re.compile(
......
from typing import List, Tuple
from src.detections import DateDetection, Optional
......
from typing import Any, Dict, List, Tuple
import regex as re
from typing import List, Dict, Any, Tuple
from src.detections import EmailDetection
from src.detectors.interface import Detector
......
from typing import List, Dict, Any, Tuple
from src.detections import Detection
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Tuple
from src.detections import Detection
class Detector(ABC):
......@@ -17,4 +18,3 @@ class Detector(ABC):
Returns:
List[Tuple[int, int, Detection]]: List of detections.
"""
pass
from typing import List, Dict, Any, Tuple
from typing import Dict, List, Tuple
from src.annotations import (Annotation, MorphosyntacticAnnotation,
NerAnnotation)
from src.detections import (DETECTION_CLASSES_MAP, Detection,
MorphosyntacticInfoMixin)
from src.detectors.interface import Detector
from src.detections import Detection, MorphosyntacticInfoMixin
from src.annotations import Annotation, NerAnnotation, MorphosyntacticAnnotation
from src.detections import DETECTION_CLASSES_MAP
class NerDetector(Detector):
......
from typing import Any, Dict, List, Tuple
import regex as re
from typing import List, Dict, Any, Tuple
from src.detections import NumberDetection
from src.detectors.interface import Detector
......
from typing import Any, Dict, List, Tuple
import regex as re
from typing import List, Dict, Any, Tuple
from src.detections import PhoneNumberDetection
from src.detectors.interface import Detector
......
from typing import List
import regex as re
from typing import List, Tuple
def generate_url_regex(exeptions: List[str]) -> str:
......
from typing import Any, Dict, List, Tuple
import regex as re
from typing import List, Dict, Any, Tuple
from .pl import URL_REGEX_PL
from .common import generate_url_regex
from src.detections import UrlDetection
from src.detectors.interface import Detector
from .common import generate_url_regex
from .pl import URL_REGEX_PL
class UrlDetector(Detector):
def __init__(self, language: str = "pl") -> None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment