Views
No views yet
model.predict with a 🤗 Dataset with tokens, document_id and sentence_id columns.
See the documentation of the model.predict method for more information.span_marker library:pip install span_marker1from span_marker import SpanMarkerModel
2
3# Download from the 🤗 Hub
4model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-xlm-roberta-large-conllpp-doc-context")
5# Run inference
6entities = model.predict("Amelia Earhart flew her single engine Lockheed Vega 5B across the Atlantic to Paris.")1# ✅
2model.predict("He plays J. Robert Oppenheimer , an American theoretical physicist .")
3# ❌
4model.predict("He plays J. Robert Oppenheimer, an American theoretical physicist.")
5
6# You can also supply a list of words directly: ✅
7model.predict(["He", "plays", "J.", "Robert", "Oppenheimer", ",", "an", "American", "theoretical", "physicist", "."])"l'ocean Atlantique" into "l' ocean Atlantique".