{"id":3650,"date":"2024-04-12T18:47:38","date_gmt":"2024-04-12T13:17:38","guid":{"rendered":"https:\/\/newsdata.io\/blog\/?p=3650"},"modified":"2024-04-17T12:48:36","modified_gmt":"2024-04-17T07:18:36","slug":"annotation-of-news-data-using-openais-gpt","status":"publish","type":"post","link":"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/","title":{"rendered":"How To Use OpenAI&#8217;s GPT 3.5 To Annotate News Data"},"content":{"rendered":"[vc_row type=&#8221;in_container&#8221; full_screen_row_position=&#8221;middle&#8221; column_margin=&#8221;default&#8221; column_direction=&#8221;default&#8221; column_direction_tablet=&#8221;default&#8221; column_direction_phone=&#8221;default&#8221; scene_position=&#8221;center&#8221; text_color=&#8221;dark&#8221; text_align=&#8221;left&#8221; row_border_radius=&#8221;none&#8221; row_border_radius_applies=&#8221;bg&#8221; overflow=&#8221;visible&#8221; overlay_strength=&#8221;0.3&#8243; gradient_direction=&#8221;left_to_right&#8221; shape_divider_position=&#8221;bottom&#8221; bg_image_animation=&#8221;none&#8221;][vc_column column_padding=&#8221;no-extra-padding&#8221; column_padding_tablet=&#8221;inherit&#8221; column_padding_phone=&#8221;inherit&#8221; column_padding_position=&#8221;all&#8221; column_element_direction_desktop=&#8221;default&#8221; column_element_spacing=&#8221;default&#8221; desktop_text_alignment=&#8221;default&#8221; tablet_text_alignment=&#8221;default&#8221; phone_text_alignment=&#8221;default&#8221; background_color_opacity=&#8221;1&#8243; background_hover_color_opacity=&#8221;1&#8243; column_backdrop_filter=&#8221;none&#8221; column_shadow=&#8221;none&#8221; column_border_radius=&#8221;none&#8221; column_link_target=&#8221;_self&#8221; column_position=&#8221;default&#8221; gradient_direction=&#8221;left_to_right&#8221; overlay_strength=&#8221;0.3&#8243; width=&#8221;1\/4&#8243; tablet_width_inherit=&#8221;default&#8221; animation_type=&#8221;default&#8221; bg_image_animation=&#8221;none&#8221; border_type=&#8221;simple&#8221; column_border_width=&#8221;none&#8221; column_border_style=&#8221;solid&#8221; column_padding_type=&#8221;default&#8221; gradient_type=&#8221;default&#8221; offset=&#8221;vc_hidden-sm vc_hidden-xs&#8221;][\/vc_column][vc_column column_padding=&#8221;no-extra-padding&#8221; column_padding_tablet=&#8221;inherit&#8221; column_padding_phone=&#8221;inherit&#8221; column_padding_position=&#8221;all&#8221; column_element_direction_desktop=&#8221;default&#8221; column_element_spacing=&#8221;default&#8221; desktop_text_alignment=&#8221;default&#8221; tablet_text_alignment=&#8221;default&#8221; phone_text_alignment=&#8221;default&#8221; background_color_opacity=&#8221;1&#8243; background_hover_color_opacity=&#8221;1&#8243; column_backdrop_filter=&#8221;none&#8221; column_shadow=&#8221;none&#8221; column_border_radius=&#8221;none&#8221; column_link_target=&#8221;_self&#8221; column_position=&#8221;default&#8221; el_class=&#8221;text_block_wrapper&#8221; gradient_direction=&#8221;left_to_right&#8221; overlay_strength=&#8221;0.3&#8243; width=&#8221;3\/4&#8243; tablet_width_inherit=&#8221;default&#8221; animation_type=&#8221;default&#8221; bg_image_animation=&#8221;none&#8221; border_type=&#8221;simple&#8221; column_border_width=&#8221;none&#8221; column_border_style=&#8221;solid&#8221; column_padding_type=&#8221;default&#8221; gradient_type=&#8221;default&#8221; offset=&#8221;vc_col-lg-9 vc_col-md-12&#8243;][image_with_animation image_url=&#8221;3716&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;5px&#8221; box_shadow=&#8221;medium_depth&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text]Annotation is usually a manual process where a human interacts with a raw data instance to assign the tag. But, with the arrival of Large Language Models(LLMs) &#8211; the idea of human in-loop data annotation could be automated, at least for the less complex objectives.<\/p>\n<p>To automate this process we require some techniques by which we can communicate with LLMs which in general is called Prompting.<\/p>\n<p>In this blog post, we will explore how LLMs can help us to annotate textual data (news data). We will be using OpenAI API (since it is popular \ud83d\ude09) but you can try with other open-source or closed-source models, for the same.[\/vc_column_text][vc_column_text]\n<h2><strong>What is Data Annotation?<\/strong><\/h2>\n[\/vc_column_text][vc_column_text]Data Annotation is the process of tagging data (which could be text, image, speech, etc.) by humans usually, with meaningful context, to train the Machine Learning(ML) models as per the output we expect.[\/vc_column_text][vc_column_text]\n<h3><strong>Benefits of Annotation using OpenAI GPT<\/strong><\/h3>\n[\/vc_column_text][vc_column_text]\n<ul>\n<li>It improves model accuracy by providing high-quality data to learn for the AI models.<\/li>\n<li>It provides domain-specific insights into the data.<\/li>\n<li>Annotated data helps AI models to generalize better.<\/li>\n<li>It helps reduce the bias of the AI model.<\/li>\n<\/ul>\n[\/vc_column_text][vc_column_text]\n<h2><strong>Why LLM as Data Annotators?<\/strong><\/h2>\n[\/vc_column_text][vc_column_text]LLMs work well for few-shot prompting (few-shot learning is like a quick learner who can understand new things with just a few examples) or even for zero-shot prompting (zero-shot learning allows machines to learn about new categories or concepts without any direct examples) like GPT-3, GPT-4, Claude, Gemini, etc.<\/p>\n<p>For downstream tasks that require fewer features for building models like classification, LLMs are a good choice since they are trained on vast amounts of data, which enable them to understand the complex structure of the text. This understanding of the nature of the sentence allows LLMs to perform better on downstream tasks when provided with a with a well-defined prompt.[\/vc_column_text][vc_column_text]\n<h2><strong>Setting up Newsdata.io and OpenAI<\/strong><\/h2>\n[\/vc_column_text][vc_column_text]It is better to use a Python environment as both Newsdata.io and OpenAI provide Python client libraries. We will use text data (news) from Newsdata.io to annotate using OpenAI API for Sentiment Analysis.<\/p>\n<p>The objective is to annotate the news into one of the three sentiment categories &#8211; \u201cNegative\u201d, \u201cNeutral\u201d or \u201cPositive\u201d. To fetch news data from <a href=\"https:\/\/newsdata.io\/\">newsdata.io<\/a> using Python client, please follow the guidelines below.[\/vc_column_text][vc_column_text]<b>Step 1:<\/b> Create an account on <a href=\"https:\/\/newsdata.io\/\">newsdata.io<\/a><br \/>\n<b>Step 2:<\/b> Go to the Dashboard and get your API key.<br \/>\n<b>Step 3:<\/b> To install the Newsdata Python library run the following command in your command line.[\/vc_column_text][image_with_animation image_url=&#8221;3655&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;5px&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text]<b>Step 4:<\/b> Now, Import the NewsDataAPIClient module in your Python file and set your API key. And, get the newsdata response. Here is the example Python script to get news items from newsdata.io. You can pass other parameters in news_api to filter news as per your requirement.[\/vc_column_text][vc_column_text]Please check newsdata.io documentation for other parameters <a href=\"https:\/\/newsdata.io\/documentation\">(here)<\/a>[\/vc_column_text][image_with_animation image_url=&#8221;3662&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;5px&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text]I suggest you go through this blog <a href=\"https:\/\/newsdata.io\/blog\/how-to-make-your-first-request-with-newsdata-io\/\">(here)<\/a> to get more insights into how to fetch news from newsdata.io.[\/vc_column_text][vc_column_text]Follow the steps below to get the OpenAI\u2019s API key and set up the OpenAI Python library.[\/vc_column_text][vc_column_text]<b>Step 1:<\/b> Create an account at <a href=\"https:\/\/openai.com\/\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/openai.com<\/a><br \/>\n<b>Step 2:<\/b> Add your payment method to use API calls. For this go to Settings \u2192 Billing \u2192 Payment Methods.<br \/>\n<b>Step 3:<\/b> Then go to <a href=\"https:\/\/platform.openai.com\/api-keys\">api_keys<\/a> and generate your api key, by clicking over Create new secret key.<br \/>\n<b>Step 4:<\/b> To install the OpenAI Python library run the following command in your command line.[\/vc_column_text][image_with_animation image_url=&#8221;3657&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;5px&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text]Before going further, we will have to set the OpenAI API key in the project Environment.<\/p>\n<p><b>Step 5:<\/b> Create a .env file in your project repository &#8211; a special file that stores sensitive information like API keys, Passwords, etc.<br \/>\n<b>Step 6:<\/b> Add your API key to this file. This line should look like OPENAI_API_KEY=your-api-key-here.[\/vc_column_text][vc_column_text]To read more about this, visit <a href=\"https:\/\/platform.openai.com\/docs\/quickstart\">https:\/\/platform.openai.com\/docs\/quickstart<\/a>[\/vc_column_text][image_with_animation image_url=&#8221;3658&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;none&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text]\n<h2><strong>Understanding Data<\/strong><\/h2>\n[\/vc_column_text][vc_column_text]We are already done with our Python client setup, both for Newsdata.io and OpenAI.<\/p>\n<p>Newsdata.io API provides 50 news items in a single response for a single API call (provided limit is not set to less than 50).<\/p>\n<p>All these 50 news items are available in the \u201cresult\u201d field of the response JSON object.<\/p>\n<p>A single news item looks like this in the response object.[\/vc_column_text][image_with_animation image_url=&#8221;3661&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;5px&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text]One of the most interesting facts about any news data is that the entire essence of news is encapsulated in the title of the news. As it captures the attention of readers and hence summarizes the important information in a few words.<\/p>\n<p>We will leverage this property of news titles to find the sentiment of news instances without looking into the entire news.[\/vc_column_text][vc_column_text]\n<h2><strong>Why Only the News Headline is Sufficient?<\/strong><\/h2>\n[\/vc_column_text][vc_column_text]Why is it enough to just look into the title of news data for sentiment analysis?<\/p>\n<p>This is because of the intrinsic nature of news titles. If the news instance is in the good or bad spectrum &#8211; the title of the news will definitely reflect it. This makes it easy to capture the attention of readers.<\/p>\n<p>Moreover, it will lead to less number of tokens in the input of Open AI API calls and hence less cost.[\/vc_column_text][vc_column_text]\n<h2><strong>Annotation of News Data<\/strong><\/h2>\n[\/vc_column_text][vc_column_text]Finding sentiment is not a complex task, so we can use gpt-3.5 turbo with chat completion API in JSON mode.<\/p>\n<p>Why JSON mode? gpt-3.5 turbo Chat completion just produces a stream of tokens or words, based on prompts provided to the model.<\/p>\n<p>But in our case, we just want a single element as output for each news item, from this set [\u201cNegative\u201d, \u201cNeutral\u201d, \u201cPositive\u201d]. So, we have to restrict the model with JSON mode to produce output in a structured JSON format and force it to get only relevant output. We can then parse this JSON object to get the sentiment of news data.<\/p>\n<p>But usually, GPT doesn&#8217;t produce structured JSON objects. To resolve this it is a good practice to force the model to produce a JSON object in response.<\/p>\n<p>In order to achieve this you can set \u201cresponse_format\u201d to json_object type.<\/p>\n<p>Also, you have to explicitly mention in your prompt to produce a JSON response, or else the model will keep producing a stream of whitespaces. [\/vc_column_text][image_with_animation image_url=&#8221;3665&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;5px&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text]\nYou can also pass other parameters to create a function in the above code to get more optimized output[\/vc_column_text][vc_column_text]\n<ul>\n<li><b>temperature &#8211;<\/b> This parameter justifies the creativity of the model. The default value is 1 and the range is from 0 to 2. For straightforward classification tasks like sentiment, it is advisable to set the temperature to 0.2.<\/li>\n<\/ul>\n[\/vc_column_text][image_with_animation image_url=&#8221;3663&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;none&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text]\n<ul>\n<li><b>presence_penalty &#8211;<\/b> It encourages you to mix things up and use different words instead of repeating the same ones over and over again. Better not to set in our case &#8211; as we only want the model to generate one of the three words or classes ie. positive, negative, or neutral.<\/li>\n<li><b>frequency_penalty &#8211;<\/b> The default value is 0, and penalty values typically range from 0.1 to 1. A higher value will make the model less inclined to reuse the same words.<\/li>\n<li><b>top_p &#8211;<\/b> It is quite similar to temperature. And it is recommended not to use both of them together. For generation, the model decides to put the next word or token in the output which has a probability equal to top_p or more.[\/vc_column_text][vc_column_text]\n<h2><strong>Response Result<\/strong><\/h2>\n[\/vc_column_text][vc_column_text]The expected response from OpenAI looks like this. The output of the model can be found in the \u201ccontent\u201d part of the message.choices in response.[\/vc_column_text][image_with_animation image_url=&#8221;3664&#8243; image_size=&#8221;full&#8221; animation_type=&#8221;entrance&#8221; animation=&#8221;None&#8221; animation_movement_type=&#8221;transform_y&#8221; hover_animation=&#8221;none&#8221; alignment=&#8221;&#8221; border_radius=&#8221;5px&#8221; box_shadow=&#8221;none&#8221; image_loading=&#8221;default&#8221; max_width=&#8221;100%&#8221; max_width_mobile=&#8221;default&#8221;][vc_column_text]The OpenAI ChatCompletion response carries other information like if you want to keep track of the number of tokens exhausted for input and output to ensure your budget.<\/p>\n<p>Another thing to care about is the finished reason (suggests if there was any other reason for the output generated by the model). If stopped, it means the completion was generated successfully. Another reason could be length, which means the language model ran out of tokens before being able to finish the completion.<\/p>\n<p>This helps you to take care of your cost optimization. For example, In the above response &#8211; a total of 93 tokens were exhausted.[\/vc_column_text][vc_column_text]\n<h2><strong>Conclusion<\/strong><\/h2>\n[\/vc_column_text][vc_column_text]In this blog, we have seen the potential of LLMs, especially GPT-3 for news data annotation.<\/p>\n<p>By harnessing the power of LLMs through the OpenAI API, we can even automate the classification of news data for emotion analysis, tagging into different categories, multilabel tag assignment, etc.<\/p>\n<p>Although <a href=\"https:\/\/newsdata.io\/\" target=\"_blank\" rel=\"noopener\">newsdata.io<\/a> provides sentiment analysis of news along with AI tags at a much affordable price.[\/vc_column_text][\/vc_column][\/vc_row][vc_row type=&#8221;in_container&#8221; full_screen_row_position=&#8221;middle&#8221; column_margin=&#8221;default&#8221; column_direction=&#8221;default&#8221; column_direction_tablet=&#8221;default&#8221; column_direction_phone=&#8221;default&#8221; scene_position=&#8221;center&#8221; text_color=&#8221;dark&#8221; text_align=&#8221;left&#8221; row_border_radius=&#8221;none&#8221; row_border_radius_applies=&#8221;bg&#8221; overflow=&#8221;visible&#8221; overlay_strength=&#8221;0.3&#8243; gradient_direction=&#8221;left_to_right&#8221; shape_divider_position=&#8221;bottom&#8221; bg_image_animation=&#8221;none&#8221;][vc_column column_padding=&#8221;no-extra-padding&#8221; column_padding_tablet=&#8221;inherit&#8221; column_padding_phone=&#8221;inherit&#8221; column_padding_position=&#8221;all&#8221; column_element_direction_desktop=&#8221;default&#8221; column_element_spacing=&#8221;default&#8221; desktop_text_alignment=&#8221;default&#8221; tablet_text_alignment=&#8221;default&#8221; phone_text_alignment=&#8221;default&#8221; background_color_opacity=&#8221;1&#8243; background_hover_color_opacity=&#8221;1&#8243; column_backdrop_filter=&#8221;none&#8221; column_shadow=&#8221;none&#8221; column_border_radius=&#8221;none&#8221; column_link_target=&#8221;_self&#8221; column_position=&#8221;default&#8221; gradient_direction=&#8221;left_to_right&#8221; overlay_strength=&#8221;0.3&#8243; width=&#8221;1\/1&#8243; tablet_width_inherit=&#8221;default&#8221; animation_type=&#8221;default&#8221; bg_image_animation=&#8221;none&#8221; border_type=&#8221;simple&#8221; column_border_width=&#8221;none&#8221; column_border_style=&#8221;solid&#8221;][vc_column_text]<\/li>\n<\/ul>\n[\/vc_column_text][\/vc_column][\/vc_row]\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Learn the step-by-step approach to fetching news data and how to make annotations for sentiment analysis of news using the OpenAI API and its integration with newsdata.io<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":15,"featured_media":3716,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[140,142,141,143],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Use OpenAI&#039;s GPT 3.5 To Annotate News Data<\/title>\n<meta name=\"description\" content=\"Learn the step-by-step approach to fetching news data and how to make annotations for sentiment analysis of news using the OpenAI API and its integration with newsdata.io\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Use OpenAI&#039;s GPT 3.5 To Annotate News Data\" \/>\n<meta property=\"og:description\" content=\"Learn the step-by-step approach to fetching news data and how to make annotations for sentiment analysis of news using the OpenAI API and its integration with newsdata.io\" \/>\n<meta property=\"og:url\" content=\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/\" \/>\n<meta property=\"og:site_name\" content=\"Newsdata.io - Stay Updated with the Latest News API Trends\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-12T13:17:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-17T07:18:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Pashupati\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pashupati\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/\",\"url\":\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/\",\"name\":\"How To Use OpenAI's GPT 3.5 To Annotate News Data\",\"isPartOf\":{\"@id\":\"https:\/\/newsdata.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png?fit=1200%2C675&ssl=1\",\"datePublished\":\"2024-04-12T13:17:38+00:00\",\"dateModified\":\"2024-04-17T07:18:36+00:00\",\"author\":{\"@id\":\"https:\/\/newsdata.io\/blog\/#\/schema\/person\/4f90ea86af36479975f904d7f22e948f\"},\"description\":\"Learn the step-by-step approach to fetching news data and how to make annotations for sentiment analysis of news using the OpenAI API and its integration with newsdata.io\",\"breadcrumb\":{\"@id\":\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png?fit=1200%2C675&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png?fit=1200%2C675&ssl=1\",\"width\":1200,\"height\":675},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/newsdata.io\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Use OpenAI&#8217;s GPT 3.5 To Annotate News Data\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/newsdata.io\/blog\/#website\",\"url\":\"https:\/\/newsdata.io\/blog\/\",\"name\":\"Newsdata.io - Stay Updated with the Latest News API Trends\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/newsdata.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/newsdata.io\/blog\/#\/schema\/person\/4f90ea86af36479975f904d7f22e948f\",\"name\":\"Pashupati\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newsdata.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1cd5ea53d7b58155f8b9ed1cd074ddda?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1cd5ea53d7b58155f8b9ed1cd074ddda?s=96&d=mm&r=g\",\"caption\":\"Pashupati\"},\"description\":\"With 2+ years in machine learning, I specialize in language and vision modeling, bringing industrial expertise to every project. As an ML developer, I excel in crafting innovative solutions that push technological boundaries. From natural language processing to computer vision, I thrive on tackling complex challenges. Passionate about staying ahead in this dynamic field.\",\"url\":\"https:\/\/newsdata.io\/blog\/author\/pashupati\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Use OpenAI's GPT 3.5 To Annotate News Data","description":"Learn the step-by-step approach to fetching news data and how to make annotations for sentiment analysis of news using the OpenAI API and its integration with newsdata.io","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:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/","og_locale":"en_US","og_type":"article","og_title":"How To Use OpenAI's GPT 3.5 To Annotate News Data","og_description":"Learn the step-by-step approach to fetching news data and how to make annotations for sentiment analysis of news using the OpenAI API and its integration with newsdata.io","og_url":"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/","og_site_name":"Newsdata.io - Stay Updated with the Latest News API Trends","article_published_time":"2024-04-12T13:17:38+00:00","article_modified_time":"2024-04-17T07:18:36+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png","type":"image\/png"}],"author":"Pashupati","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Pashupati","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/","url":"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/","name":"How To Use OpenAI's GPT 3.5 To Annotate News Data","isPartOf":{"@id":"https:\/\/newsdata.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#primaryimage"},"image":{"@id":"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png?fit=1200%2C675&ssl=1","datePublished":"2024-04-12T13:17:38+00:00","dateModified":"2024-04-17T07:18:36+00:00","author":{"@id":"https:\/\/newsdata.io\/blog\/#\/schema\/person\/4f90ea86af36479975f904d7f22e948f"},"description":"Learn the step-by-step approach to fetching news data and how to make annotations for sentiment analysis of news using the OpenAI API and its integration with newsdata.io","breadcrumb":{"@id":"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#primaryimage","url":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png?fit=1200%2C675&ssl=1","contentUrl":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png?fit=1200%2C675&ssl=1","width":1200,"height":675},{"@type":"BreadcrumbList","@id":"https:\/\/newsdata.io\/blog\/annotation-of-news-data-using-openais-gpt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/newsdata.io\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Use OpenAI&#8217;s GPT 3.5 To Annotate News Data"}]},{"@type":"WebSite","@id":"https:\/\/newsdata.io\/blog\/#website","url":"https:\/\/newsdata.io\/blog\/","name":"Newsdata.io - Stay Updated with the Latest News API Trends","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/newsdata.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/newsdata.io\/blog\/#\/schema\/person\/4f90ea86af36479975f904d7f22e948f","name":"Pashupati","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newsdata.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1cd5ea53d7b58155f8b9ed1cd074ddda?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1cd5ea53d7b58155f8b9ed1cd074ddda?s=96&d=mm&r=g","caption":"Pashupati"},"description":"With 2+ years in machine learning, I specialize in language and vision modeling, bringing industrial expertise to every project. As an ML developer, I excel in crafting innovative solutions that push technological boundaries. From natural language processing to computer vision, I thrive on tackling complex challenges. Passionate about staying ahead in this dynamic field.","url":"https:\/\/newsdata.io\/blog\/author\/pashupati\/"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png?fit=1200%2C675&ssl=1","category":["API"],"featured_image_url":"https:\/\/i0.wp.com\/newsdata.io\/blog\/wp-content\/uploads\/2024\/04\/ANNOTATION-2.png?fit=1200%2C675&ssl=1","_links":{"self":[{"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts\/3650"}],"collection":[{"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/comments?post=3650"}],"version-history":[{"count":3,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts\/3650\/revisions"}],"predecessor-version":[{"id":3760,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/posts\/3650\/revisions\/3760"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/media\/3716"}],"wp:attachment":[{"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/media?parent=3650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/categories?post=3650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newsdata.io\/blog\/wp-json\/wp\/v2\/tags?post=3650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}