Views
No views yet
group-appeal-detector package, which also provides stance classification and mention clustering.roberta-baseB-socialgroup, I-socialgroup, O| Seqeval-Metric | Score |
|---|---|
| F1 | 0.82 [0.82, 0.83] |
| Precision | 0.80 [0.79, 0.81] |
| Recall | 0.84 [0.83, 0.85] |
group-appeal-detector package (recommended)pip install group-appeal-detector1from group_appeal_detector import GroupAppealDetector
2
3detector = GroupAppealDetector(device="cpu")
4
5sentence = "Our party supports the interests of young people and working families."
6mentions = detector.detect_mentions(sentence)
7
8for m in mentions:
9 print(m["span"], m["start"], m["end"])1sentences = [
2 "Farmers must earn more money.",
3 "The government must do more to protect the women living in this country.",
4]
5results_df = detector.detect_mentions_batch(sentences, batch_size=8, as_df=True)1from transformers import pipeline
2
3pipe = pipeline(
4 "token-classification",
5 model="maxwlnd/roberta_group_mention_detector",
6 aggregation_strategy="simple",
7)
8
9sentence = "Our party supports the interests of young people and working families."
10results = pipe(sentence)
11
12for r in results:
13 print(r["word"], r["entity_group"], round(r["score"], 3))| Model | Task |
|---|---|
maxwlnd/roberta_group_mention_detector | Detect social group mentions (this model) |
maxwlnd/socialgroup_stance_classification_nli | Classify stance toward a group as positive, negative, or neutral |
maxwlnd/cl_mention_embedding | Embed mentions for clustering into qualitative categories |