Views
No views yet
exp5.1) of
ahalt/event-attribute-extractor
and supersedes it — position-corrected LLM-judge evaluation against ECAV gold
labels shows +4pp actor accuracy and +1pp joint (actor+recipient) accuracy, and a
+4pp joint win rate against gold. See "Evaluation" below.event-attribute-extractor. Prompting it in the old format does not raise an
error, but will return somewhatworse spans. If you use this model through
the NGEC package, ngec.attribute_model.AttributeModel handles this automatically by
keying the prompt format off the model name (see KNOWN_PROMPT_FORMATS). If you use it
standalone, use the format below, not the one on the old model card.1from vllm import LLM, SamplingParams
2from transformers import AutoTokenizer
3
4model = LLM(model="ahalt/qwen3-event-extraction-exp5.1",
5 enable_prefix_caching=True,
6 max_model_len=8000,
7 gpu_memory_utilization=0.80)
8
9tokenizer = AutoTokenizer.from_pretrained("ahalt/qwen3-event-extraction-exp5.1")
10
11sampling_params = SamplingParams(
12 temperature=0.5, # Greedy decoding breaks Qwen
13 top_p=0.8, # Qwen3 non-thinking recommendation
14 top_k=20, # Qwen3 recommendation
15 presence_penalty=1.5, # Recommended for quantized models
16 min_p=0.0,
17 max_tokens=2048, # this model runs longer than the old one's 1024
18)## Event Type:, as a single string; there is no
closing "extract the attributes" instruction, because the system prompt already carries
it.1system_content = """Given the event type definition below, find all instances of that event in the document and extract their attributes as JSON.
2
3OUTPUT FORMAT:
4[
5 {
6 "event_type": "EVENT_TYPE",
7 "anchor_quote": "exact 5-15 word quote from text",
8 "actor": "who performed action OR N/A",
9 "recipient": "who was targeted OR N/A",
10 "date": "when occurred OR N/A",
11 "location": "where occurred OR N/A"
12 }
13]
14
15RULES:
16- All values must be exact spans copied from the text. Do not rephrase.
17- ACTOR: The person, group, or entity who performed the action. Use N/A only if truly unknown/unstated. Descriptions like "gunman" or "suicide bomber" ARE valid actors.
18- LOCATION: Use the most specific named place (city > region > country).
19- Use short, concise spans. Omit articles (a/an/the) and unnecessary context.
20- Multiple values: separate with semicolons.
21- Return [] if no events of the specified type are present.
22- Follow any Special Instructions provided with the event type definition."""
23
24
25def make_prompt(doc, event_type, event_def, tokenizer, mode_def=None, extraction_notes=None):
26 definition = f"## Event: **{event_type}**: {event_def}"
27 if mode_def:
28 definition += f" ## Specific Sub-Event: {mode_def}"
29 if extraction_notes:
30 definition += f" ## Special Instructions: {extraction_notes}"
31 user_content = f"## Document: {doc}\n\n## Event Type: {definition}"
32
33 messages = [
34 {"role": "system", "content": system_content},
35 {"role": "user", "content": user_content},
36 ]
37 return tokenizer.apply_chat_template(
38 messages,
39 tokenize=False,
40 add_generation_prompt=True,
41 enable_thinking=False,
42 )PLOVER_structured_codebook_updated.csv in the NGEC package) — this model was trained
to expect the definition text, not just the bare type name, after ## Event Type:.1text = """KYIV, Ukraine (AP) — Ukraine's anti-corruption agencies said they had uncovered a major graft scheme involving inflated military procurement contracts, just two days after Ukraine's parliament voted to restore the agencies' independence.
2
3In a joint statement published Saturday on social media, the National Anti-Corruption Bureau (NABU) and the Specialized Anti-Corruption Prosecutor's Office (SAPO) said the suspects had taken bribes in a scheme that used state funds to buy drones and other military equipment at inflated prices.
4
5"The essence of the scheme was to conclude state contracts with supplier companies at deliberately inflated prices," the statement said, adding that offenders had received kickbacks of up to 30% of the contracts' value."""
6
7event_type = "INVESTIGATE"
8event_def = ("Investigate, charge, or prosecute a person or organization for "
9 "wrongdoing, corruption, or crime.")
10
11prompt = make_prompt(text, event_type, event_def, tokenizer)
12output = model.generate(prompt, sampling_params=sampling_params)
13response = output[0].outputs[0].text.strip()
14
15# [{"event_type": "INVESTIGATE",
16# "anchor_quote": "uncovered a major graft scheme involving inflated military procurement contracts",
17# "actor": "National Anti-Corruption Bureau (NABU); Specialized Anti-Corruption Prosecutor's Office (SAPO)",
18# "recipient": "suspects",
19# "date": "Saturday",
20# "location": "Ukraine"}]Qwen/Qwen3-0.6B for 1 epoch on a synthetic attribute-extraction
dataset built from PLOVER-coded news documents, using the prompt format shown above.
See the paper for the full data-generation and training methodology.temperature=0.5. Greedy decoding degrades this model, consistent with
Qwen3's own recommendation against greedy decoding for non-thinking mode.