Created
August 10, 2022 12:43
-
-
Save pmbaumgartner/85b3a0256131e86fbdd78a8b4060d361 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import TypedDict | |
DisplacyDepsWords = TypedDict( | |
"DisplacyDepsWords", {"text": str, "tag": str, "lemma": Optional[str]} | |
) | |
DisplacyDepsArcs = TypedDict( | |
"DisplacyDepsArcs", {"start": int, "end": int, "label": str, "dir": str} | |
) | |
DisplacyDepsData = TypedDict( | |
"DisplacyDepsData", | |
{ | |
"arcs": List[DisplacyDepsArcs], | |
"words": List[DisplacyDepsWords], | |
"settings": Dict[str, Any], | |
}, | |
) | |
DisplacyEnt = TypedDict( | |
"DisplacyEnt", {"start": int, "end": int, "label": str, "kb_id": str, "kb_url": str} | |
) | |
DisplacyEntData = TypedDict( | |
"DisplacyEntData", | |
{"text": str, "ents": List[DisplacyEnt], "title": str, "settings": Dict[str, Any]}, | |
) | |
DisplacySpan = TypedDict( | |
"DisplacySpan", | |
{ | |
"start": int, | |
"end": int, | |
"start_token": int, | |
"end_token": int, | |
"label": str, | |
"kb_id": str, | |
"kb_url": str, | |
}, | |
) | |
DisplacySpanData = TypedDict( | |
"DisplacySpanData", | |
{ | |
"text": str, | |
"spans": List[DisplacySpan], | |
"title": str, | |
"settings": Dict[str, Any], | |
"tokens": List[str], | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment