Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pipeline support for SpanMarker #34

Merged
merged 4 commits into from
Sep 29, 2023
Merged

Add pipeline support for SpanMarker #34

merged 4 commits into from
Sep 29, 2023

Conversation

tomaarsen
Copy link
Owner

Hello!

Pull Request overview

  • Add support for pipeline.

Details

>>> from span_marker import pipeline
>>> pipe = pipeline(task="span-marker", model="tomaarsen/span-marker-mbert-base-multinerd", device_map="auto")
>>> pipe("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")
[{'span': 'Amelia Earhart', 'label': 'PER', 'score': 0.9999709129333496, 'char_start_index': 0, 'char_end_index': 14},
    {'span': 'Lockheed Vega 5B', 'label': 'VEHI', 'score': 0.9050095677375793, 'char_start_index': 38, 'char_end_index': 54},
    {'span': 'Atlantic', 'label': 'LOC', 'score': 0.9991973042488098, 'char_start_index': 66, 'char_end_index': 74},
    {'span': 'Paris', 'label': 'LOC', 'score': 0.9999232292175293, 'char_start_index': 78, 'char_end_index': 83}]

Note that the pipeline function is just the pipeline function from transformers.

  • Tom Aarsen

@tomaarsen tomaarsen added the enhancement New feature or request label Sep 29, 2023
@tomaarsen tomaarsen merged commit 506c25b into main Sep 29, 2023
8 checks passed
@tomaarsen tomaarsen deleted the feat/pipelines branch September 29, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant