How to use the dataprep.Token function in dataprep

To help you get started, we’ve selected a few dataprep examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github allenai / spv2 / dataprep.py View on Github external
def from_json(cls, json_token):
        return Token(
            text=str(json_token["text"]),
            font=str(json_token["font"]),
            left=float(json_token["left"]),
            right=float(json_token["right"]),
            top=float(json_token["top"]),
            bottom=float(json_token["bottom"]),
            font_size=float(json_token["fontSize"]),
            space_width=float(json_token["fontSpaceWidth"])
        )