<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic using openai Api in Databricks without iterating rows in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/using-openai-api-in-databricks-without-iterating-rows/m-p/57895#M2883</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi to everyone,&lt;/P&gt;&lt;P&gt;I have a delta table with a column 'comment' I would like to add a new column 'sentiment', and I would like to calculate it using openai API.&lt;/P&gt;&lt;P&gt;I already know how to create a databricks endpoint to an external model and how to use it (using for example langchain) on a single comment or iterating the comments in a table.&lt;/P&gt;&lt;P&gt;I would like to know if there is a way to do it more efficiently using an udf, or if it is possible to create a model in Databricks that calls the openai API with a fixed prompt, then create an endpoint to that model and call that in an udf.&lt;/P&gt;&lt;P&gt;Thank you in advance for the response, I hope my question is clear, if not let me know and I will try to explain it better&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jan 2024 16:16:05 GMT</pubDate>
    <dc:creator>Alessandro</dc:creator>
    <dc:date>2024-01-19T16:16:05Z</dc:date>
    <item>
      <title>using openai Api in Databricks without iterating rows</title>
      <link>https://community.databricks.com/t5/machine-learning/using-openai-api-in-databricks-without-iterating-rows/m-p/57895#M2883</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi to everyone,&lt;/P&gt;&lt;P&gt;I have a delta table with a column 'comment' I would like to add a new column 'sentiment', and I would like to calculate it using openai API.&lt;/P&gt;&lt;P&gt;I already know how to create a databricks endpoint to an external model and how to use it (using for example langchain) on a single comment or iterating the comments in a table.&lt;/P&gt;&lt;P&gt;I would like to know if there is a way to do it more efficiently using an udf, or if it is possible to create a model in Databricks that calls the openai API with a fixed prompt, then create an endpoint to that model and call that in an udf.&lt;/P&gt;&lt;P&gt;Thank you in advance for the response, I hope my question is clear, if not let me know and I will try to explain it better&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 16:16:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/using-openai-api-in-databricks-without-iterating-rows/m-p/57895#M2883</guid>
      <dc:creator>Alessandro</dc:creator>
      <dc:date>2024-01-19T16:16:05Z</dc:date>
    </item>
  </channel>
</rss>

