Views
No views yet
jvaquet/multilabel-classification-bert.1from transformers import pipeline
2
3pipe = pipeline(model='jvaquet/multilabel-classification-bert-ace2004',
4 stride=128,
5 threshold=0.5,
6 use_hierarchy_heuristic=False,
7 trust_remote_code=True)
8
9entities = pipe(my_text)stride - int: Stride for the tokenizer. When the text length exceeds tokenizer.model_max_length, it splits the input accordingly with the specified stride.threshold - float: Threshold for entitiy detection. Sigmoid of the logits.use_hierarchy_heuristic - bool: Apply heuristic to suppress additional entities when entities of same class overlap hierarchically.