{"id":240,"date":"2024-03-30T23:19:05","date_gmt":"2024-03-30T23:19:05","guid":{"rendered":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/?p=240"},"modified":"2024-04-01T13:35:15","modified_gmt":"2024-04-01T13:35:15","slug":"sandra-serbus-status-report-for-3-30-24","status":"publish","type":"post","link":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/2024\/03\/30\/sandra-serbus-status-report-for-3-30-24\/","title":{"rendered":"Sandra Serbu&#8217;s Status Report for 3\/30\/24"},"content":{"rendered":"<p>This week was focused on building an OpenAI API for text generation and integration with other project components. OpenAI&#8217;s text generation capabilities are extensive and offer a range of input modalities and model parameterization.\u00a0 In their tutorials and documentation, OpenAI &#8220;recommend[s] first attempting to get good results with prompt engineering, prompt chaining (breaking complex tasks into multiple prompts), and function calling.&#8221; To do so, I started by asking ChatGPT to &#8220;translate&#8221; ASL given syntactically ASL sentences. ChatGPT had a lot of success doing this correctly given isolates phrases without much context or prompting. I then went to\u00a0 describe my prompt as GPT will be used in the context of our project as follows:<\/p>\n<blockquote><p>I will give you sequential single word inputs. Your objective is to correctly interpret a sequence of signed ASL words in accordance with ASL grammar and syntax rules and construct an appropriate english sentence translation. You can expect Subject, Verb, Object word order and topic-comment sentence structure. Upon receiving a new word input, you should respond with your best approximation of a complete English sentence using the words you&#8217;ve been given so far. Can you do that?<\/p><\/blockquote>\n<p>It worked semi successfully but ChatGPT had substantial difficulty moving away from the &#8220;conversational&#8221; context it&#8217;s expected to function within.<\/p>\n<p><span style=\"font-size: 1rem\">So far, I&#8217;ve used ChatGPT-4 and some personal credits to work in the OpenAI API playground but would like to limit personal spending on LLM building and fine-tuning going forward. I would like to use credits towards gpt-3.5-turbo since fine-tuning for GPT-4 is in an experimental access program and for the scope of our project, I expect gpt-3.5-turbo to be a robust model for in terms of accurate translation results.<\/span><\/p>\n<pre><code>from openai import OpenAI\r\nclient = OpenAI()<\/code>\r\n\r\n<code>behavior = \"You are an assistant that receives word by word inputs and interprets them in accordance with ASL grammatical syntax. Once a complete sentence can be formed, that sentence should be sent to the user as a response. If more than 10 seconds have passed since the last word, you should send a response to the user with the current sentence.\"\r\nresponse = client.chat.completions.create(\r\nmodel=\"gpt-3.5-turbo\",\r\nmessages=[\r\n{\"role\": \"system\", \"content\": behavior},\r\n{\"role\": \"user\", \"content\": \"last\"},\r\n{\"role\": \"user\", \"content\": \"year\"},\r\n{\"role\": \"user\", \"content\": \"me\"},\r\n{\"role\": \"user\", \"content\": \"went\"},\r\n{\"role\": \"user\", \"content\": \"Spain\"},\r\n{\"role\": \"assistant\", \"content\": \"I went to Spain a year ago.\"},\r\n{\"role\": \"user\", \"content\": \"where\"}\r\n])<\/code><\/pre>\n<p>The system message helps set the behavior of the assistant.<\/p>\n<p>eventually, we would like to use an Openai text generation model such that we provide word inputs as a stream and only receive text in complete English sentences.<\/p>\n<p>SVO (Subject, Verb, Object) is the most common sentence word order in ASL and\u00a0Object, Subject, Verb (OSV) necessarily uses non-manual features (facial expression) to\u00a0introduce the object of a sentence as the topic. As a result, we will restrict the scope of our current LLM to successfully interpreting SVO sign order.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week was focused on building an OpenAI API for text generation and integration with other project components. OpenAI&#8217;s text generation capabilities are extensive and offer a range of input modalities and model parameterization.\u00a0 In their tutorials and documentation, OpenAI &#8220;recommend[s] first attempting to get good results with prompt engineering, prompt chaining (breaking complex tasks &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/2024\/03\/30\/sandra-serbus-status-report-for-3-30-24\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Sandra Serbu&#8217;s Status Report for 3\/30\/24&#8221;<\/span><\/a><\/p>\n","protected":false},"author":889,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,7],"tags":[],"_links":{"self":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/posts\/240"}],"collection":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/users\/889"}],"replies":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":1,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":241,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/posts\/240\/revisions\/241"}],"wp:attachment":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s24-teame6\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}