diff --git a/spacy/pipeline/coordinationruler.py b/spacy/pipeline/coordinationruler.py index a056f5f93..31ae729c5 100644 --- a/spacy/pipeline/coordinationruler.py +++ b/spacy/pipeline/coordinationruler.py @@ -1,11 +1,12 @@ import re from typing import Callable, List, Optional, Union +import pydantic from pydantic import BaseModel -try: +if pydantic.VERSION.split(".")[0] == "1": # type: ignore from pydantic import validator # type: ignore -except ImportError: +else: from pydantic import field_validator as validator # type: ignore from ..language import Language