{"id":3347,"date":"2023-08-29T19:41:12","date_gmt":"2023-08-29T19:41:12","guid":{"rendered":"https:\/\/nilg.ai\/?p=3347"},"modified":"2025-03-17T11:57:06","modified_gmt":"2025-03-17T11:57:06","slug":"classifying-text-using-llms","status":"publish","type":"post","link":"https:\/\/nilg.ai\/pt\/202308\/classifying-text-using-llms\/","title":{"rendered":"Classifying text using LLMs"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"wp-image-3356 aligncenter\" src=\"https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-300x200.jpg\" alt=\"\" width=\"494\" height=\"330\" srcset=\"https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-300x200.jpg 300w, https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-1024x683.jpg 1024w, https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-768x513.jpg 768w, https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-1536x1025.jpg 1536w, https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-2048x1367.jpg 2048w, https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-1920x1281.jpg 1920w, https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-600x400.jpg 600w\" sizes=\"(max-width: 494px) 100vw, 494px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Text classification is one of the most common use cases in Natural Language Processing, with numerous practical applications &#8211; now easier to access with Large Language Models. Companies use text classification in multiple scenarios to become more efficient:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\"><strong>Tagging large volumes of data:<\/strong> reducing manual labor with better filtering, automatically organizing large volumes of text.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\"><strong>Enhancing Search\/Recommendation Systems:<\/strong> Search and recommendation can be enhanced by a better understanding of the searched queries.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\"><strong>Sentiment Analysis:<\/strong> Understanding public opinion\/customer feedback by determining the emotion expressed in text is valuable for.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\"><strong>Customer Support:<\/strong> Facilitate ticket prioritization and routing to the correct team by categorizing customer support tickets.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">All of these use cases were solvable in the past without using LLMs. However, the uprising of these models has reduced the amount of necessary training data for obtaining good results, and has also increased the average performance of these use cases, taking less time for reaching them!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In this blog post, we will cover several techniques for text classification before the uprising of the most recent LLMs (OpenAI, LLaMA, Bing, \u2026) and after.\u00a0\u00a0<\/span><\/p>\n<section class=\"cta-card-section\">\n    <div class=\"grid-container\">\n        <div class=\"whitepaper\">\n            <div class=\"whitepaper__wrap\">\n\n                                    <div class=\"whitepaper__img\">\n                        <img decoding=\"async\" src=\"https:\/\/nilg.ai\/wp-content\/uploads\/2024\/01\/book_cover2.png\"\n                            alt=\"\"\/>\n                    <\/div>\n                \n                <div class=\"whitepaper__content\">\n\n                                            <h3 class=\"whitepaper__title\">FREE eBook: How to transform your business with AI<\/h3>\n                                            <p class=\"whitepaper__text medium\">Download our eBook and discover the most common pitfalls when implementing AI projects and how to prevent them.<\/p>\n                                            <a href=\"https:\/\/get.nilg.ai\/eBook-business-centric-AI\" class=\"whitepaper__button button cta-card-btn fancybox\" aria-label=\"Send me the eBook\" data-fancybox data-src=\"#download-cta-popup\">Send me the eBook<\/a>\n                                    <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/section>\n\n    <div class=\"download-cta-popup\" style=\"display: none;\" id=\"download-cta-popup\">\n        <div class=\"modal-popup\">\n            <div class=\"grid-x grid-margin-x\">\n                <div class=\"cell medium-4\">\n                    <div class=\"modal-popup__bg\"><\/div>\n                <\/div>\n                <div class=\"cell medium-8\">\n                    <div class=\"modal-popup__content\">\n                        <script type=\"text\/javascript\">var gform;gform||(document.addEventListener(\"gform_main_scripts_loaded\",function(){gform.scriptsLoaded=!0}),window.addEventListener(\"DOMContentLoaded\",function(){gform.domLoaded=!0}),gform={domLoaded:!1,scriptsLoaded:!1,initializeOnLoaded:function(o){gform.domLoaded&&gform.scriptsLoaded?o():!gform.domLoaded&&gform.scriptsLoaded?window.addEventListener(\"DOMContentLoaded\",o):document.addEventListener(\"gform_main_scripts_loaded\",o)},hooks:{action:{},filter:{}},addAction:function(o,n,r,t){gform.addHook(\"action\",o,n,r,t)},addFilter:function(o,n,r,t){gform.addHook(\"filter\",o,n,r,t)},doAction:function(o){gform.doHook(\"action\",o,arguments)},applyFilters:function(o){return gform.doHook(\"filter\",o,arguments)},removeAction:function(o,n){gform.removeHook(\"action\",o,n)},removeFilter:function(o,n,r){gform.removeHook(\"filter\",o,n,r)},addHook:function(o,n,r,t,i){null==gform.hooks[o][n]&&(gform.hooks[o][n]=[]);var e=gform.hooks[o][n];null==i&&(i=n+\"_\"+e.length),gform.hooks[o][n].push({tag:i,callable:r,priority:t=null==t?10:t})},doHook:function(n,o,r){var t;if(r=Array.prototype.slice.call(r,1),null!=gform.hooks[n][o]&&((o=gform.hooks[n][o]).sort(function(o,n){return o.priority-n.priority}),o.forEach(function(o){\"function\"!=typeof(t=o.callable)&&(t=window[t]),\"action\"==n?t.apply(null,r):r[0]=t.apply(null,r)})),\"filter\"==n)return r[0]},removeHook:function(o,n,t,i){var r;null!=gform.hooks[o][n]&&(r=(r=gform.hooks[o][n]).filter(function(o,n,r){return!!(null!=i&&i!=o.tag||null!=t&&t!=o.priority)}),gform.hooks[o][n]=r)}});<\/script>\n                <div class='gf_browser_gecko gform_wrapper gravity-theme' id='gform_wrapper_14' >\n                        <div class='gform_heading'>\n                            <h2 class=\"gform_title\">Get Bonus Content!<\/h2>\n                        <\/div><form method='post' enctype='multipart\/form-data' target='gform_ajax_frame_14' id='gform_14'  action='\/pt\/wp-json\/wp\/v2\/posts\/3347' novalidate>\n                        <div class='gform_body gform-body'><div id='gform_fields_14' class='gform_fields top_label form_sublabel_below description_below'><div id=\"field_14_1\"  class=\"gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible\"  data-js-reload=\"field_14_1\"><label class='gfield_label' for='input_14_1' >Name<span class=\"gfield_required\"><span class=\"gfield_required gfield_required_text\">(Required)<\/span><\/span><\/label><div class='ginput_container ginput_container_text'><input name='input_1' id='input_14_1' type='text' value='' class='large'     aria-required=\"true\" aria-invalid=\"false\"   \/> <\/div><\/div><div id=\"field_14_3\"  class=\"gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible\"  data-js-reload=\"field_14_3\"><label class='gfield_label' for='input_14_3' >Email<span class=\"gfield_required\"><span class=\"gfield_required gfield_required_text\">(Required)<\/span><\/span><\/label><div class='ginput_container ginput_container_email'>\n                            <input name='input_3' id='input_14_3' type='email' value='' class='large'    aria-required=\"true\" aria-invalid=\"false\"  \/>\n                        <\/div><\/div><div id=\"field_14_5\"  class=\"gfield gfield--width-full gform_hidden field_sublabel_below field_description_below gfield_visibility_visible\"  data-js-reload=\"field_14_5\"><div class='ginput_container ginput_container_text'><input name='input_5' id='input_14_5' type='hidden' class='gform_hidden'  aria-invalid=\"false\" value='https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/posts\/3347' \/><\/div><\/div><fieldset id=\"field_14_4\"  class=\"gfield gfield--width-full gfield_contains_required field_sublabel_below field_description_below hidden_label gfield_visibility_visible\"  data-js-reload=\"field_14_4\"><legend class='gfield_label gfield_label_before_complex'  >submitting form agree policy<span class=\"gfield_required\"><span class=\"gfield_required gfield_required_text\">(Required)<\/span><\/span><\/legend><div class='ginput_container ginput_container_checkbox'><div class='gfield_checkbox' id='input_14_4'><div class='gchoice gchoice_14_4_1'>\n\t\t\t\t\t\t\t\t<input class='gfield-choice-input' name='input_4.1' type='checkbox'  value='By submitting this form I agree to Terms and Privacy Policy.'  id='choice_14_4_1'   \/>\n\t\t\t\t\t\t\t\t<label for='choice_14_4_1' id='label_14_4_1'>By submitting this form I agree to Terms and Privacy Policy.<\/label>\n\t\t\t\t\t\t\t<\/div><\/div><\/div><\/fieldset><div id=\"field_14_6\"  class=\"gfield gform_validation_container field_sublabel_below field_description_below gfield_visibility_visible\"  data-js-reload=\"field_14_6\"><label class='gfield_label' for='input_14_6' >Name<\/label><div class='ginput_container'><input name='input_6' id='input_14_6' type='text' value='' autocomplete='new-password'\/><\/div><div class='gfield_description' id='gfield_description_14_6'>This field is for validation purposes and should be left unchanged.<\/div><\/div><\/div><\/div>\n        <div class='gform_footer top_label'> <button class='button expand gform_button' id='gform_submit_button_14'>Send it now!<\/button> <input type='hidden' name='gform_ajax' value='form_id=14&amp;title=1&amp;description=&amp;tabindex=0' \/>\n            <input type='hidden' class='gform_hidden' name='is_submit_14' value='1' \/>\n            <input type='hidden' class='gform_hidden' name='gform_submit' value='14' \/>\n            \n            <input type='hidden' class='gform_hidden' name='gform_unique_id' value='' \/>\n            <input type='hidden' class='gform_hidden' name='state_14' value='WyJbXSIsIjRiMmVmOTAxZmI1MjBmOGVhYWZiMmY5Y2QyYmIyZjY2Il0=' \/>\n            <input type='hidden' class='gform_hidden' name='gform_target_page_number_14' id='gform_target_page_number_14' value='0' \/>\n            <input type='hidden' class='gform_hidden' name='gform_source_page_number_14' id='gform_source_page_number_14' value='1' \/>\n            <input type='hidden' name='gform_field_values' value='' \/>\n            \n        <\/div>\n                        <\/form>\n                        <\/div>\n                <iframe style='display:none;width:0px;height:0px;' src='about:blank' name='gform_ajax_frame_14' id='gform_ajax_frame_14' title='This iframe contains the logic required to handle Ajax powered Gravity Forms.'><\/iframe>\n                <script>\ngform.initializeOnLoaded( function() {gformInitSpinner( 14, 'https:\/\/nilg.ai\/wp-content\/plugins\/gravityforms\/images\/spinner.svg' );jQuery('#gform_ajax_frame_14').on('load',function(){var contents = jQuery(this).contents().find('*').html();var is_postback = contents.indexOf('GF_AJAX_POSTBACK') >= 0;if(!is_postback){return;}var form_content = jQuery(this).contents().find('#gform_wrapper_14');var is_confirmation = jQuery(this).contents().find('#gform_confirmation_wrapper_14').length > 0;var is_redirect = contents.indexOf('gformRedirect(){') >= 0;var is_form = form_content.length > 0 && ! is_redirect && ! is_confirmation;var mt = parseInt(jQuery('html').css('margin-top'), 10) + parseInt(jQuery('body').css('margin-top'), 10) + 100;if(is_form){jQuery('#gform_wrapper_14').html(form_content.html());if(form_content.hasClass('gform_validation_error')){jQuery('#gform_wrapper_14').addClass('gform_validation_error');} else {jQuery('#gform_wrapper_14').removeClass('gform_validation_error');}setTimeout( function() { \/* delay the scroll by 50 milliseconds to fix a bug in chrome *\/  }, 50 );if(window['gformInitDatepicker']) {gformInitDatepicker();}if(window['gformInitPriceFields']) {gformInitPriceFields();}var current_page = jQuery('#gform_source_page_number_14').val();gformInitSpinner( 14, 'https:\/\/nilg.ai\/wp-content\/plugins\/gravityforms\/images\/spinner.svg' );jQuery(document).trigger('gform_page_loaded', [14, current_page]);window['gf_submitting_14'] = false;}else if(!is_redirect){var confirmation_content = jQuery(this).contents().find('.GF_AJAX_POSTBACK').html();if(!confirmation_content){confirmation_content = contents;}setTimeout(function(){jQuery('#gform_wrapper_14').replaceWith(confirmation_content);jQuery(document).trigger('gform_confirmation_loaded', [14]);window['gf_submitting_14'] = false;wp.a11y.speak(jQuery('#gform_confirmation_message_14').text());}, 50);}else{jQuery('#gform_14').append(contents);if(window['gformRedirect']) {gformRedirect();}}jQuery(document).trigger('gform_post_render', [14, current_page]);} );} );\n<\/script>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n\n<h2>Most common techniques for Text Classification using Large Language Models<\/h2>\n<p><span style=\"font-weight: 400;\">The most common techniques for text classification are:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Zero-Shot Classification:<\/b><span style=\"font-weight: 400;\"> asking a model for a label directly, without giving any examples. Although it\u2019s the simplest option, and you don\u2019t need any data, performance is quite limited, and you can end-up with an outcome that is not a part of your fixed class list (hallucination).\u00a0<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Pre-LLMs: <\/b><span style=\"font-weight: 400;\">Using open-source models such as <\/span><a href=\"https:\/\/github.com\/flairNLP\/flair\"><span style=\"font-weight: 400;\">TARS<\/span><\/a><span style=\"font-weight: 400;\">\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Post-LLMs:<\/b><span style=\"font-weight: 400;\"> Directly requesting LLMs to generate a label, passing a final structure. This approach is slower than pre-LLMs: although much more accurate.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li aria-level=\"1\"><b>Few-Shot Classification: <\/b><span style=\"font-weight: 400;\">you pass a few examples per class, and require a low amount of annotated data.<\/span>\n<ul>\n<li><b>Pre-LLMs: <\/b><span style=\"font-weight: 400;\">Using open-source models such as TARS<\/span><\/li>\n<li><b>Post-LLMs<\/b><span style=\"font-weight: 400;\">: Using LLMs by passing in the prompt\u2019s context the samples of each class. Will be more accurate than the previous approach.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li aria-level=\"1\"><b>Raw embedding feature extraction: <\/b><span style=\"font-weight: 400;\">we convert the text into a numerical representation (embedding) and train a model on top of that, which retrieves a probability score that can be used for making decisions.\u00a0 However, you require a larger amount of annotated data.\u00a0\u00a0\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Pre-LLMs:<\/b><span style=\"font-weight: 400;\"> Using open-source embeddings such as <\/span><a href=\"https:\/\/nlp.stanford.edu\/projects\/glove\/\"><span style=\"font-weight: 400;\">GloVE<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Post-LLMs: <\/b><span style=\"font-weight: 400;\">Using <\/span><a href=\"https:\/\/platform.openai.com\/docs\/guides\/embeddings\"><span style=\"font-weight: 400;\">OpenAI embeddings<\/span><\/a><span style=\"font-weight: 400;\">, which are trained on larger amounts of data and typically outperform <\/span><a href=\"https:\/\/derrickofori015.medium.com\/gpt-3-vs-other-text-embeddings-techniques-for-text-classification-a-performance-evaluation-b3a3e6e84cb7\"><span style=\"font-weight: 400;\">other embedding methods<\/span><\/a><span style=\"font-weight: 400;\">. This is a paid option, of which you need to consider the trade-offs compared to using an open source solution.\u00a0<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li aria-level=\"1\"><b>Embeddings of enriched text: <\/b><span style=\"font-weight: 400;\">Before extracting the embeddings, we try to uncover more information about the text, \u201cenriching it\u201d.\u00a0<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Pre-LLMs: <\/b><span style=\"font-weight: 400;\">Not frequently used.\u00a0<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li aria-level=\"2\"><b>Post-LLMs: <\/b><span style=\"font-weight: 400;\">ask the LLM to give you more information about the text: for example, if it\u2019s a Google Search, LLMs can give you more information about what that search encompasses. It\u2019s a slower approach than Pre-LLMs, but it\u2019s the technique with the highest scores we\u2019ve seen so far.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p style=\"text-align: center;\"><i><span style=\"font-weight: 400;\">\u201cLet&#8217;s assume you&#8217;re an Encyclopedia, and you have to define the concepts I&#8217;m providing. Your explanation must be succinct (couple of paragraphs), like the summary section of a Wikipedia article talking about the concept. (&#8230;)\u201d<\/span><\/i><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\"><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Below is a comparative chart, summarizing the trade-offs of the methods in terms of required data, speed and accuracy.<\/p>\n<h2><img decoding=\"async\" class=\"wp-image-3348 aligncenter\" src=\"https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/Comparative-Chart-281x300.png\" alt=\"\" width=\"457\" height=\"488\" srcset=\"https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/Comparative-Chart-281x300.png 281w, https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/Comparative-Chart-300x320.png 300w, https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/Comparative-Chart.png 466w\" sizes=\"(max-width: 457px) 100vw, 457px\" \/><\/h2>\n<p>&nbsp;<\/p>\n<h2><b>Conclusion<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">We showed you several ways of doing text classification using Large Language Models. LLMs allow you to reach acceptable performance in a few hours of work and are pretty good for an initial benchmark &#8211; despite this, don\u2019t forget about older methods, which can be a fallback when you want faster outcomes or when paying for LLMs\u2019 requests is not feasible in the scale of your use case.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Want to revolutionize the way you do text classification? Know more by contacting us!<\/span><\/p>\n  \n\n <div class=\"author-cta\">\n\t\t<div class=\"author-cta-img\">\n\t\t    \n\t\t    <img decoding=\"async\" width=\"1024\" height=\"906\" src=\"https:\/\/nilg.ai\/wp-content\/uploads\/2022\/07\/Web-Rafael.png\" class=\"attachment-full size-full\" alt=\"Rafael Cavalheiro NILG.AI\" srcset=\"https:\/\/nilg.ai\/wp-content\/uploads\/2022\/07\/Web-Rafael.png 1024w, https:\/\/nilg.ai\/wp-content\/uploads\/2022\/07\/Web-Rafael-300x265.png 300w, https:\/\/nilg.ai\/wp-content\/uploads\/2022\/07\/Web-Rafael-768x680.png 768w, https:\/\/nilg.ai\/wp-content\/uploads\/2022\/07\/Web-Rafael-600x531.png 600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/>\t\t    <\/div>\n\n<div class=\"author-cta-content\">\n\t<h3>Do you want to further discuss this idea?<\/h3><p>Book a meeting with <strong>Rafael Cavalheiro<\/strong><\/p>\t<a class=\"cta_btn\" onclick=\"Calendly.showPopupWidget('');return false;\"  \n\">Meet Rafael<\/a>\n\t\t\t\n\t<a href=\"https:\/\/nilg.ai\/pt\/?post_type=team&p=1650\" class=\"author-cta-link\">Learn More<\/a>\n\t\t\t<\/div>\n\t<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Text classification is one of the most common use cases in Natural Language Processing, with numerous practical applications &#8211; now easier to access with Large Language Models. Companies use text classification in multiple scenarios to become more efficient: Tagging large volumes of data: reducing manual labor with better filtering, automatically organizing large volumes of [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":3356,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[48,45],"class_list":["post-3347","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical","tag-ai4tech","tag-machine-learning"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Classifying text using LLMs - NILG.AI<\/title>\n<meta name=\"description\" content=\"Learn how to do text classification using Large Language Models. It is one of the most common use cases in NLP, with many applications.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nilg.ai\/pt\/202308\/classifying-text-using-llms\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Classifying text using LLMs - NILG.AI\" \/>\n<meta property=\"og:description\" content=\"Learn how to do text classification using Large Language Models. It is one of the most common use cases in NLP, with many applications.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nilg.ai\/pt\/202308\/classifying-text-using-llms\/\" \/>\n<meta property=\"og:site_name\" content=\"NILG.AI\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-29T19:41:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-17T11:57:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-1024x683.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"683\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Paulo Maia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nilg_ai\" \/>\n<meta name=\"twitter:site\" content=\"@nilg_ai\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paulo Maia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/\"},\"author\":{\"name\":\"Paulo Maia\",\"@id\":\"https:\/\/nilg.ai\/#\/schema\/person\/a860b9395bd25c5090160a3ac30e980d\"},\"headline\":\"Classifying text using LLMs\",\"datePublished\":\"2023-08-29T19:41:12+00:00\",\"dateModified\":\"2025-03-17T11:57:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/\"},\"wordCount\":684,\"publisher\":{\"@id\":\"https:\/\/nilg.ai\/#organization\"},\"keywords\":[\"AI4tech\",\"Machine Learning\"],\"articleSection\":[\"Technical\"],\"inLanguage\":\"pt-PT\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/\",\"url\":\"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/\",\"name\":\"Classifying text using LLMs - NILG.AI\",\"isPartOf\":{\"@id\":\"https:\/\/nilg.ai\/#website\"},\"datePublished\":\"2023-08-29T19:41:12+00:00\",\"dateModified\":\"2025-03-17T11:57:06+00:00\",\"description\":\"Learn how to do text classification using Large Language Models. It is one of the most common use cases in NLP, with many applications.\",\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/nilg.ai\/#website\",\"url\":\"https:\/\/nilg.ai\/\",\"name\":\"NILG.AI\",\"description\":\"Create ever-improving businesses with AI\",\"publisher\":{\"@id\":\"https:\/\/nilg.ai\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/nilg.ai\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pt-PT\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/nilg.ai\/#organization\",\"name\":\"NILG.AI\",\"url\":\"https:\/\/nilg.ai\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\/\/nilg.ai\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/nilg.ai\/wp-content\/uploads\/2022\/03\/logo.svg\",\"contentUrl\":\"https:\/\/nilg.ai\/wp-content\/uploads\/2022\/03\/logo.svg\",\"caption\":\"NILG.AI\"},\"image\":{\"@id\":\"https:\/\/nilg.ai\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/nilg_ai\",\"https:\/\/youtube.com\/@nilg_ai\",\"https:\/\/www.linkedin.com\/company\/nilg-ai\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/nilg.ai\/#\/schema\/person\/a860b9395bd25c5090160a3ac30e980d\",\"name\":\"Paulo Maia\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\/\/nilg.ai\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9e3e7cb701fd6dcee37f7a4e9f73ef5a27f5741062c4cb179724a1052ea23086?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9e3e7cb701fd6dcee37f7a4e9f73ef5a27f5741062c4cb179724a1052ea23086?s=96&d=mm&r=g\",\"caption\":\"Paulo Maia\"},\"url\":\"https:\/\/nilg.ai\/pt\/author\/paulo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Classifying text using LLMs - NILG.AI","description":"Learn how to do text classification using Large Language Models. It is one of the most common use cases in NLP, with many applications.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nilg.ai\/pt\/202308\/classifying-text-using-llms\/","og_locale":"pt_PT","og_type":"article","og_title":"Classifying text using LLMs - NILG.AI","og_description":"Learn how to do text classification using Large Language Models. It is one of the most common use cases in NLP, with many applications.","og_url":"https:\/\/nilg.ai\/pt\/202308\/classifying-text-using-llms\/","og_site_name":"NILG.AI","article_published_time":"2023-08-29T19:41:12+00:00","article_modified_time":"2025-03-17T11:57:06+00:00","og_image":[{"width":1024,"height":683,"url":"https:\/\/nilg.ai\/wp-content\/uploads\/2023\/08\/folder-overlay-word-young-people-1024x683.jpg","type":"image\/jpeg"}],"author":"Paulo Maia","twitter_card":"summary_large_image","twitter_creator":"@nilg_ai","twitter_site":"@nilg_ai","twitter_misc":{"Written by":"Paulo Maia","Est. reading time":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/#article","isPartOf":{"@id":"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/"},"author":{"name":"Paulo Maia","@id":"https:\/\/nilg.ai\/#\/schema\/person\/a860b9395bd25c5090160a3ac30e980d"},"headline":"Classifying text using LLMs","datePublished":"2023-08-29T19:41:12+00:00","dateModified":"2025-03-17T11:57:06+00:00","mainEntityOfPage":{"@id":"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/"},"wordCount":684,"publisher":{"@id":"https:\/\/nilg.ai\/#organization"},"keywords":["AI4tech","Machine Learning"],"articleSection":["Technical"],"inLanguage":"pt-PT"},{"@type":"WebPage","@id":"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/","url":"https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/","name":"Classifying text using LLMs - NILG.AI","isPartOf":{"@id":"https:\/\/nilg.ai\/#website"},"datePublished":"2023-08-29T19:41:12+00:00","dateModified":"2025-03-17T11:57:06+00:00","description":"Learn how to do text classification using Large Language Models. It is one of the most common use cases in NLP, with many applications.","inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nilg.ai\/202308\/classifying-text-using-llms\/"]}]},{"@type":"WebSite","@id":"https:\/\/nilg.ai\/#website","url":"https:\/\/nilg.ai\/","name":"NILG.AI","description":"Create ever-improving businesses with AI","publisher":{"@id":"https:\/\/nilg.ai\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nilg.ai\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pt-PT"},{"@type":"Organization","@id":"https:\/\/nilg.ai\/#organization","name":"NILG.AI","url":"https:\/\/nilg.ai\/","logo":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/nilg.ai\/#\/schema\/logo\/image\/","url":"https:\/\/nilg.ai\/wp-content\/uploads\/2022\/03\/logo.svg","contentUrl":"https:\/\/nilg.ai\/wp-content\/uploads\/2022\/03\/logo.svg","caption":"NILG.AI"},"image":{"@id":"https:\/\/nilg.ai\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/twitter.com\/nilg_ai","https:\/\/youtube.com\/@nilg_ai","https:\/\/www.linkedin.com\/company\/nilg-ai\/"]},{"@type":"Person","@id":"https:\/\/nilg.ai\/#\/schema\/person\/a860b9395bd25c5090160a3ac30e980d","name":"Paulo Maia","image":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/nilg.ai\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9e3e7cb701fd6dcee37f7a4e9f73ef5a27f5741062c4cb179724a1052ea23086?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9e3e7cb701fd6dcee37f7a4e9f73ef5a27f5741062c4cb179724a1052ea23086?s=96&d=mm&r=g","caption":"Paulo Maia"},"url":"https:\/\/nilg.ai\/pt\/author\/paulo\/"}]}},"_links":{"self":[{"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/posts\/3347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/comments?post=3347"}],"version-history":[{"count":10,"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/posts\/3347\/revisions"}],"predecessor-version":[{"id":4275,"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/posts\/3347\/revisions\/4275"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/media\/3356"}],"wp:attachment":[{"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/media?parent=3347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/categories?post=3347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nilg.ai\/pt\/wp-json\/wp\/v2\/tags?post=3347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}