Views
No views yet
| Class | Description |
|---|---|
| Background | The cited paper provides relevant Background information or is part of the body of literature. |
| Motivation | The citing paper is directly motivated by the cited paper. |
| Uses | The citing paper uses the methodology or tools created by the cited paper. |
| Extends | The citing paper extends the methods, tools or data, etc. of the cited paper. |
| Comparison or Contrast | The citing paper expresses similarities or differences to, or disagrees with, the cited paper. |
| Future | *The cited paper may be a potential avenue for future work. |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "sknow-lab/Qwen2.5-14B-CIC-ACLARC"
4
5model = AutoModelForCausalLM.from_pretrained(
6 model_name,
7 torch_dtype="auto",
8 device_map="auto"
9)
10tokenizer = AutoTokenizer.from_pretrained(model_name)
11
12system_prompt = """
13# CONTEXT #
14You are an expert researcher tasked with classifying the intent of a citation in a scientific publication.
15
16########
17
18# OBJECTIVE #
19You will be given a sentence containing a citation, you must output the appropriate class as an answer.
20
21########
22
23# CLASS DEFINITIONS #
24
25The six (6) possible classes are the following: "BACKGROUND", "MOTIVATION", "USES", "EXTENDS", "COMPARES_CONTRASTS", "FUTURE".
26
27The definitions of the classes are:
281 - BACKGROUND: The cited paper provides relevant Background information or is part of the body of literature.
292 - MOTIVATION: The citing paper is directly motivated by the cited paper.
303 - USES: The citing paper uses the methodology or tools created by the cited paper.
314 - EXTENDS: The citing paper extends the methods, tools or data, etc. of the cited paper.
325 - COMPARES_CONTRASTS: The citing paper expresses similarities or differences to, or disagrees with, the cited paper.
336 - FUTURE: The cited paper may be a potential avenue for future work.
34
35########
36
37# RESPONSE RULES #
38- Analyze only the citation marked with the @@CITATION@@ tag.
39- Assign exactly one class to each citation.
40- Respond only with the exact name of one of the following classes: "BACKGROUND", "MOTIVATION", "USES", "EXTENDS", "COMPARES_CONTRASTS", "FUTURE".
41- Do not provide any explanation or elaboration.
42"""
43
44test_citing_sentence = "However , the method we are currently using in the ATIS domain ( @@CITATION@@ ) represents our most promising approach to this problem."
45
46user_prompt = f"""
47{test_citing_sentence}
48### Question: Which is the most likely intent for this citation?
49a) BACKGROUND
50b) MOTIVATION
51c) USES
52d) EXTENDS
53e) COMPARES_CONTRASTS
54f) FUTURE
55### Answer:
56"""
57
58messages = [
59 {"role": "system", "content": system_prompt},
60 {"role": "user", "content": user_prompt}
61]
62text = tokenizer.apply_chat_template(
63 messages,
64 tokenize=False,
65 add_generation_prompt=True
66)
67model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
68
69generated_ids = model.generate(
70 **model_inputs,
71 max_new_tokens=512
72)
73generated_ids = [
74 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
75]
76
77response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
78# Response: USES@misc{koloveas2025llmspredictcitationintent,
title={Can LLMs Predict Citation Intent? An Experimental Analysis of In-context Learning and Fine-tuning on Open LLMs},
author={Paris Koloveas and Serafeim Chatzopoulos and Thanasis Vergoulis and Christos Tryfonopoulos},
year={2025},
eprint={2502.14561},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2502.14561},
}