CoCoP: Enhancing Text Classification with LLM through Code Completion Prompt Article Swipe
YOU?
·
· 2024
· Open Access
·
· DOI: https://doi.org/10.48550/arxiv.2411.08979
Text classification is a fundamental task in natural language processing (NLP), and large language models (LLMs) have demonstrated their capability to perform this task across various domains. However, the performance of LLMs heavily depends on the quality of their input prompts. Recent studies have also shown that LLMs exhibit remarkable results in code-related tasks. To leverage the capabilities of LLMs in text classification, we propose the Code Completion Prompt (CoCoP) method, which transforms the text classification problem into a code completion task. CoCoP significantly improves text classification performance across diverse datasets by utilizing LLMs' code-completion capability. For instance, CoCoP enhances the accuracy of the SST2 dataset by more than 20%. Moreover, when CoCoP integrated with LLMs specifically designed for code-related tasks (code models), such as CodeLLaMA, this method demonstrates better or comparable performance to few-shot learning techniques while using only one-tenth of the model size. The source code of our proposed method will be available to the public upon the acceptance of the paper.
Related Topics
- Type
- preprint
- Language
- en
- Landing Page
- http://arxiv.org/abs/2411.08979
- https://arxiv.org/pdf/2411.08979
- OA Status
- green
- Related Works
- 10
- OpenAlex ID
- https://openalex.org/W4404449844
Raw OpenAlex JSON
- OpenAlex ID
-
https://openalex.org/W4404449844Canonical identifier for this work in OpenAlex
- DOI
-
https://doi.org/10.48550/arxiv.2411.08979Digital Object Identifier
- Title
-
CoCoP: Enhancing Text Classification with LLM through Code Completion PromptWork title
- Type
-
preprintOpenAlex work type
- Language
-
enPrimary language
- Publication year
-
2024Year of publication
- Publication date
-
2024-11-13Full publication date if available
- Authors
-
Morteza Mohajeri, Mohammad Javad Dousti, Majid Nili AhmadabadiList of authors in order
- Landing page
-
https://arxiv.org/abs/2411.08979Publisher landing page
- PDF URL
-
https://arxiv.org/pdf/2411.08979Direct link to full text PDF
- Open access
-
YesWhether a free full text is available
- OA status
-
greenOpen access status per OpenAlex
- OA URL
-
https://arxiv.org/pdf/2411.08979Direct OA link when available
- Concepts
-
Code (set theory), Computer science, Natural language processing, Artificial intelligence, Programming language, Set (abstract data type)Top concepts (fields/topics) attached by OpenAlex
- Cited by
-
0Total citation count in OpenAlex
- Related works (count)
-
10Other works algorithmically related by OpenAlex
Full payload
| id | https://openalex.org/W4404449844 |
|---|---|
| doi | https://doi.org/10.48550/arxiv.2411.08979 |
| ids.doi | https://doi.org/10.48550/arxiv.2411.08979 |
| ids.openalex | https://openalex.org/W4404449844 |
| fwci | |
| type | preprint |
| title | CoCoP: Enhancing Text Classification with LLM through Code Completion Prompt |
| biblio.issue | |
| biblio.volume | |
| biblio.last_page | |
| biblio.first_page | |
| topics[0].id | https://openalex.org/T10181 |
| topics[0].field.id | https://openalex.org/fields/17 |
| topics[0].field.display_name | Computer Science |
| topics[0].score | 0.9764000177383423 |
| topics[0].domain.id | https://openalex.org/domains/3 |
| topics[0].domain.display_name | Physical Sciences |
| topics[0].subfield.id | https://openalex.org/subfields/1702 |
| topics[0].subfield.display_name | Artificial Intelligence |
| topics[0].display_name | Natural Language Processing Techniques |
| is_xpac | False |
| apc_list | |
| apc_paid | |
| concepts[0].id | https://openalex.org/C2776760102 |
| concepts[0].level | 3 |
| concepts[0].score | 0.614967942237854 |
| concepts[0].wikidata | https://www.wikidata.org/wiki/Q5139990 |
| concepts[0].display_name | Code (set theory) |
| concepts[1].id | https://openalex.org/C41008148 |
| concepts[1].level | 0 |
| concepts[1].score | 0.5257022380828857 |
| concepts[1].wikidata | https://www.wikidata.org/wiki/Q21198 |
| concepts[1].display_name | Computer science |
| concepts[2].id | https://openalex.org/C204321447 |
| concepts[2].level | 1 |
| concepts[2].score | 0.4783715307712555 |
| concepts[2].wikidata | https://www.wikidata.org/wiki/Q30642 |
| concepts[2].display_name | Natural language processing |
| concepts[3].id | https://openalex.org/C154945302 |
| concepts[3].level | 1 |
| concepts[3].score | 0.3396109342575073 |
| concepts[3].wikidata | https://www.wikidata.org/wiki/Q11660 |
| concepts[3].display_name | Artificial intelligence |
| concepts[4].id | https://openalex.org/C199360897 |
| concepts[4].level | 1 |
| concepts[4].score | 0.28520667552948 |
| concepts[4].wikidata | https://www.wikidata.org/wiki/Q9143 |
| concepts[4].display_name | Programming language |
| concepts[5].id | https://openalex.org/C177264268 |
| concepts[5].level | 2 |
| concepts[5].score | 0.0 |
| concepts[5].wikidata | https://www.wikidata.org/wiki/Q1514741 |
| concepts[5].display_name | Set (abstract data type) |
| keywords[0].id | https://openalex.org/keywords/code |
| keywords[0].score | 0.614967942237854 |
| keywords[0].display_name | Code (set theory) |
| keywords[1].id | https://openalex.org/keywords/computer-science |
| keywords[1].score | 0.5257022380828857 |
| keywords[1].display_name | Computer science |
| keywords[2].id | https://openalex.org/keywords/natural-language-processing |
| keywords[2].score | 0.4783715307712555 |
| keywords[2].display_name | Natural language processing |
| keywords[3].id | https://openalex.org/keywords/artificial-intelligence |
| keywords[3].score | 0.3396109342575073 |
| keywords[3].display_name | Artificial intelligence |
| keywords[4].id | https://openalex.org/keywords/programming-language |
| keywords[4].score | 0.28520667552948 |
| keywords[4].display_name | Programming language |
| language | en |
| locations[0].id | pmh:oai:arXiv.org:2411.08979 |
| locations[0].is_oa | True |
| locations[0].source.id | https://openalex.org/S4306400194 |
| locations[0].source.issn | |
| locations[0].source.type | repository |
| locations[0].source.is_oa | True |
| locations[0].source.issn_l | |
| locations[0].source.is_core | False |
| locations[0].source.is_in_doaj | False |
| locations[0].source.display_name | arXiv (Cornell University) |
| locations[0].source.host_organization | https://openalex.org/I205783295 |
| locations[0].source.host_organization_name | Cornell University |
| locations[0].source.host_organization_lineage | https://openalex.org/I205783295 |
| locations[0].license | |
| locations[0].pdf_url | https://arxiv.org/pdf/2411.08979 |
| locations[0].version | submittedVersion |
| locations[0].raw_type | text |
| locations[0].license_id | |
| locations[0].is_accepted | False |
| locations[0].is_published | False |
| locations[0].raw_source_name | |
| locations[0].landing_page_url | http://arxiv.org/abs/2411.08979 |
| locations[1].id | doi:10.48550/arxiv.2411.08979 |
| locations[1].is_oa | True |
| locations[1].source.id | https://openalex.org/S4306400194 |
| locations[1].source.issn | |
| locations[1].source.type | repository |
| locations[1].source.is_oa | True |
| locations[1].source.issn_l | |
| locations[1].source.is_core | False |
| locations[1].source.is_in_doaj | False |
| locations[1].source.display_name | arXiv (Cornell University) |
| locations[1].source.host_organization | https://openalex.org/I205783295 |
| locations[1].source.host_organization_name | Cornell University |
| locations[1].source.host_organization_lineage | https://openalex.org/I205783295 |
| locations[1].license | |
| locations[1].pdf_url | |
| locations[1].version | |
| locations[1].raw_type | article |
| locations[1].license_id | |
| locations[1].is_accepted | False |
| locations[1].is_published | |
| locations[1].raw_source_name | |
| locations[1].landing_page_url | https://doi.org/10.48550/arxiv.2411.08979 |
| indexed_in | arxiv, datacite |
| authorships[0].author.id | https://openalex.org/A5029861583 |
| authorships[0].author.orcid | |
| authorships[0].author.display_name | Morteza Mohajeri |
| authorships[0].author_position | first |
| authorships[0].raw_author_name | Mohajeri, Mohammad Mahdi |
| authorships[0].is_corresponding | False |
| authorships[1].author.id | https://openalex.org/A5001927789 |
| authorships[1].author.orcid | https://orcid.org/0000-0002-8537-2916 |
| authorships[1].author.display_name | Mohammad Javad Dousti |
| authorships[1].author_position | middle |
| authorships[1].raw_author_name | Dousti, Mohammad Javad |
| authorships[1].is_corresponding | False |
| authorships[2].author.id | https://openalex.org/A5072135442 |
| authorships[2].author.orcid | https://orcid.org/0000-0002-6370-6057 |
| authorships[2].author.display_name | Majid Nili Ahmadabadi |
| authorships[2].author_position | last |
| authorships[2].raw_author_name | Ahmadabadi, Majid Nili |
| authorships[2].is_corresponding | False |
| has_content.pdf | False |
| has_content.grobid_xml | False |
| is_paratext | False |
| open_access.is_oa | True |
| open_access.oa_url | https://arxiv.org/pdf/2411.08979 |
| open_access.oa_status | green |
| open_access.any_repository_has_fulltext | False |
| created_date | 2025-10-10T00:00:00 |
| display_name | CoCoP: Enhancing Text Classification with LLM through Code Completion Prompt |
| has_fulltext | False |
| is_retracted | False |
| updated_date | 2025-11-06T06:51:31.235846 |
| primary_topic.id | https://openalex.org/T10181 |
| primary_topic.field.id | https://openalex.org/fields/17 |
| primary_topic.field.display_name | Computer Science |
| primary_topic.score | 0.9764000177383423 |
| primary_topic.domain.id | https://openalex.org/domains/3 |
| primary_topic.domain.display_name | Physical Sciences |
| primary_topic.subfield.id | https://openalex.org/subfields/1702 |
| primary_topic.subfield.display_name | Artificial Intelligence |
| primary_topic.display_name | Natural Language Processing Techniques |
| related_works | https://openalex.org/W4391375266, https://openalex.org/W2899084033, https://openalex.org/W2748952813, https://openalex.org/W2390279801, https://openalex.org/W4391913857, https://openalex.org/W2358668433, https://openalex.org/W4396701345, https://openalex.org/W2376932109, https://openalex.org/W2001405890, https://openalex.org/W3204019825 |
| cited_by_count | 0 |
| locations_count | 2 |
| best_oa_location.id | pmh:oai:arXiv.org:2411.08979 |
| best_oa_location.is_oa | True |
| best_oa_location.source.id | https://openalex.org/S4306400194 |
| best_oa_location.source.issn | |
| best_oa_location.source.type | repository |
| best_oa_location.source.is_oa | True |
| best_oa_location.source.issn_l | |
| best_oa_location.source.is_core | False |
| best_oa_location.source.is_in_doaj | False |
| best_oa_location.source.display_name | arXiv (Cornell University) |
| best_oa_location.source.host_organization | https://openalex.org/I205783295 |
| best_oa_location.source.host_organization_name | Cornell University |
| best_oa_location.source.host_organization_lineage | https://openalex.org/I205783295 |
| best_oa_location.license | |
| best_oa_location.pdf_url | https://arxiv.org/pdf/2411.08979 |
| best_oa_location.version | submittedVersion |
| best_oa_location.raw_type | text |
| best_oa_location.license_id | |
| best_oa_location.is_accepted | False |
| best_oa_location.is_published | False |
| best_oa_location.raw_source_name | |
| best_oa_location.landing_page_url | http://arxiv.org/abs/2411.08979 |
| primary_location.id | pmh:oai:arXiv.org:2411.08979 |
| primary_location.is_oa | True |
| primary_location.source.id | https://openalex.org/S4306400194 |
| primary_location.source.issn | |
| primary_location.source.type | repository |
| primary_location.source.is_oa | True |
| primary_location.source.issn_l | |
| primary_location.source.is_core | False |
| primary_location.source.is_in_doaj | False |
| primary_location.source.display_name | arXiv (Cornell University) |
| primary_location.source.host_organization | https://openalex.org/I205783295 |
| primary_location.source.host_organization_name | Cornell University |
| primary_location.source.host_organization_lineage | https://openalex.org/I205783295 |
| primary_location.license | |
| primary_location.pdf_url | https://arxiv.org/pdf/2411.08979 |
| primary_location.version | submittedVersion |
| primary_location.raw_type | text |
| primary_location.license_id | |
| primary_location.is_accepted | False |
| primary_location.is_published | False |
| primary_location.raw_source_name | |
| primary_location.landing_page_url | http://arxiv.org/abs/2411.08979 |
| publication_date | 2024-11-13 |
| publication_year | 2024 |
| referenced_works_count | 0 |
| abstract_inverted_index.a | 3, 78 |
| abstract_inverted_index.To | 54 |
| abstract_inverted_index.as | 124 |
| abstract_inverted_index.be | 153 |
| abstract_inverted_index.by | 91, 106 |
| abstract_inverted_index.in | 6, 51, 60 |
| abstract_inverted_index.is | 2 |
| abstract_inverted_index.of | 30, 37, 58, 102, 141, 148, 161 |
| abstract_inverted_index.on | 34 |
| abstract_inverted_index.or | 130 |
| abstract_inverted_index.to | 20, 133, 155 |
| abstract_inverted_index.we | 63 |
| abstract_inverted_index.For | 96 |
| abstract_inverted_index.The | 145 |
| abstract_inverted_index.and | 11 |
| abstract_inverted_index.for | 118 |
| abstract_inverted_index.our | 149 |
| abstract_inverted_index.the | 28, 35, 56, 65, 73, 100, 103, 142, 156, 159, 162 |
| abstract_inverted_index.20%. | 109 |
| abstract_inverted_index.Code | 66 |
| abstract_inverted_index.LLMs | 31, 47, 59, 115 |
| abstract_inverted_index.SST2 | 104 |
| abstract_inverted_index.Text | 0 |
| abstract_inverted_index.also | 44 |
| abstract_inverted_index.code | 79, 147 |
| abstract_inverted_index.have | 16, 43 |
| abstract_inverted_index.into | 77 |
| abstract_inverted_index.more | 107 |
| abstract_inverted_index.only | 139 |
| abstract_inverted_index.such | 123 |
| abstract_inverted_index.task | 5, 23 |
| abstract_inverted_index.text | 61, 74, 85 |
| abstract_inverted_index.than | 108 |
| abstract_inverted_index.that | 46 |
| abstract_inverted_index.this | 22, 126 |
| abstract_inverted_index.upon | 158 |
| abstract_inverted_index.when | 111 |
| abstract_inverted_index.will | 152 |
| abstract_inverted_index.with | 114 |
| abstract_inverted_index.(code | 121 |
| abstract_inverted_index.CoCoP | 82, 98, 112 |
| abstract_inverted_index.LLMs' | 93 |
| abstract_inverted_index.input | 39 |
| abstract_inverted_index.large | 12 |
| abstract_inverted_index.model | 143 |
| abstract_inverted_index.shown | 45 |
| abstract_inverted_index.size. | 144 |
| abstract_inverted_index.task. | 81 |
| abstract_inverted_index.tasks | 120 |
| abstract_inverted_index.their | 18, 38 |
| abstract_inverted_index.using | 138 |
| abstract_inverted_index.which | 71 |
| abstract_inverted_index.while | 137 |
| abstract_inverted_index.(LLMs) | 15 |
| abstract_inverted_index.(NLP), | 10 |
| abstract_inverted_index.Prompt | 68 |
| abstract_inverted_index.Recent | 41 |
| abstract_inverted_index.across | 24, 88 |
| abstract_inverted_index.better | 129 |
| abstract_inverted_index.method | 127, 151 |
| abstract_inverted_index.models | 14 |
| abstract_inverted_index.paper. | 163 |
| abstract_inverted_index.public | 157 |
| abstract_inverted_index.source | 146 |
| abstract_inverted_index.tasks. | 53 |
| abstract_inverted_index.(CoCoP) | 69 |
| abstract_inverted_index.dataset | 105 |
| abstract_inverted_index.depends | 33 |
| abstract_inverted_index.diverse | 89 |
| abstract_inverted_index.exhibit | 48 |
| abstract_inverted_index.heavily | 32 |
| abstract_inverted_index.method, | 70 |
| abstract_inverted_index.natural | 7 |
| abstract_inverted_index.perform | 21 |
| abstract_inverted_index.problem | 76 |
| abstract_inverted_index.propose | 64 |
| abstract_inverted_index.quality | 36 |
| abstract_inverted_index.results | 50 |
| abstract_inverted_index.studies | 42 |
| abstract_inverted_index.various | 25 |
| abstract_inverted_index.However, | 27 |
| abstract_inverted_index.accuracy | 101 |
| abstract_inverted_index.datasets | 90 |
| abstract_inverted_index.designed | 117 |
| abstract_inverted_index.domains. | 26 |
| abstract_inverted_index.enhances | 99 |
| abstract_inverted_index.few-shot | 134 |
| abstract_inverted_index.improves | 84 |
| abstract_inverted_index.language | 8, 13 |
| abstract_inverted_index.learning | 135 |
| abstract_inverted_index.leverage | 55 |
| abstract_inverted_index.models), | 122 |
| abstract_inverted_index.prompts. | 40 |
| abstract_inverted_index.proposed | 150 |
| abstract_inverted_index.Moreover, | 110 |
| abstract_inverted_index.available | 154 |
| abstract_inverted_index.instance, | 97 |
| abstract_inverted_index.one-tenth | 140 |
| abstract_inverted_index.utilizing | 92 |
| abstract_inverted_index.CodeLLaMA, | 125 |
| abstract_inverted_index.Completion | 67 |
| abstract_inverted_index.acceptance | 160 |
| abstract_inverted_index.capability | 19 |
| abstract_inverted_index.comparable | 131 |
| abstract_inverted_index.completion | 80 |
| abstract_inverted_index.integrated | 113 |
| abstract_inverted_index.processing | 9 |
| abstract_inverted_index.remarkable | 49 |
| abstract_inverted_index.techniques | 136 |
| abstract_inverted_index.transforms | 72 |
| abstract_inverted_index.capability. | 95 |
| abstract_inverted_index.fundamental | 4 |
| abstract_inverted_index.performance | 29, 87, 132 |
| abstract_inverted_index.capabilities | 57 |
| abstract_inverted_index.code-related | 52, 119 |
| abstract_inverted_index.demonstrated | 17 |
| abstract_inverted_index.demonstrates | 128 |
| abstract_inverted_index.specifically | 116 |
| abstract_inverted_index.significantly | 83 |
| abstract_inverted_index.classification | 1, 75, 86 |
| abstract_inverted_index.classification, | 62 |
| abstract_inverted_index.code-completion | 94 |
| cited_by_percentile_year | |
| countries_distinct_count | 0 |
| institutions_distinct_count | 3 |
| citation_normalized_percentile |