{"id":3545,"date":"2024-11-09T19:23:02","date_gmt":"2024-11-09T13:53:02","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=3545"},"modified":"2024-11-09T19:23:02","modified_gmt":"2024-11-09T13:53:02","slug":"semantic-search-in-wolfram-mathematica","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2024\/11\/09\/semantic-search-in-wolfram-mathematica\/","title":{"rendered":"Semantic Search in Wolfram Mathematica"},"content":{"rendered":"<p>In an earlier <a href=\"https:\/\/www.rangakrish.com\/index.php\/2024\/10\/02\/using-openai-from-mathematica-part-2\/\" target=\"_blank\" rel=\"noopener\"><em><strong>article<\/strong><\/em><\/a>, I explained how to use <em><strong>OpenAI<\/strong><\/em> from <em><strong>Wolfram Mathematica<\/strong><\/em> ver 14.1. This latest release of <em><strong>Wolfram<\/strong><\/em> supports <em><strong>Semantic Search<\/strong><\/em> as well. In today\u2019s article, let me discuss this feature.<\/p>\n<p>As in the case of using <em><strong>LLMs<\/strong><\/em>, using <em><strong>Semantic Search<\/strong><\/em> requires an account with one of the supported vendors. I will continue to use <em><strong>OpenAI<\/strong><\/em> for this functionality too.<\/p>\n<p>For this example, I am going to create three short text fragments, each describing a homeopathy remedy briefly. The remedies are <em><strong>Lycopodium<\/strong><\/em>, <em><strong>Argentum Nitricum<\/strong><\/em> and <em><strong>Natrum Muriaticum<\/strong><\/em>.<\/p>\n<figure id=\"attachment_3546\" aria-describedby=\"caption-attachment-3546\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/image1.png?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"3546\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2024\/11\/09\/semantic-search-in-wolfram-mathematica\/image1-11\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/image1.png\" data-orig-size=\"1546,1160\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Remedy Description\" data-image-description=\"&lt;p&gt;Remedy Description&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Remedy Description&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/image1-1024x768.png\" class=\"wp-image-3546\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/image1.png?resize=550%2C413&#038;ssl=1\" alt=\"Remedy Description\" width=\"550\" height=\"413\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/image1.png?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/image1.png?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/image1.png?resize=768%2C576&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/image1.png?resize=1536%2C1152&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/image1.png?w=1546&amp;ssl=1 1546w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3546\" class=\"wp-caption-text\"><strong>Remedy Description<\/strong><\/figcaption><\/figure>\n<p>I am going to build a semantic search database for the above text fragments.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<figure id=\"attachment_3547\" aria-describedby=\"caption-attachment-3547\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/createindex.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3547\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2024\/11\/09\/semantic-search-in-wolfram-mathematica\/createindex\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/createindex.png\" data-orig-size=\"1558,158\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Creating a Semantic Search Index\" data-image-description=\"&lt;p&gt;Creating a Semantic Search Index&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Creating a Semantic Search Index&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/createindex-1024x104.png\" class=\"wp-image-3547\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/createindex.png?resize=500%2C51&#038;ssl=1\" alt=\"Creating a Semantic Search Index\" width=\"500\" height=\"51\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/createindex.png?resize=300%2C30&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/createindex.png?resize=1024%2C104&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/createindex.png?resize=768%2C78&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/createindex.png?resize=1536%2C156&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/createindex.png?w=1558&amp;ssl=1 1558w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3547\" class=\"wp-caption-text\"><strong>Creating a Semantic Search Index<\/strong><\/figcaption><\/figure>\n<p>The above function returns an index object after storing two texts. I have given a convenient label, in this case the remedy name, for the texts. In addition, since the data size is quite small, I am creating an in-memory database instead of using a persistent file object. Finally, I am specifying the minimum and maximum token limits for each chunk. The reason I am using small values for these is because my text fragments are small.<\/p>\n<p>The function returns an <em><strong>Index<\/strong><\/em> object that has several properties:<\/p>\n<figure id=\"attachment_3548\" aria-describedby=\"caption-attachment-3548\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/index.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3548\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2024\/11\/09\/semantic-search-in-wolfram-mathematica\/index\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/index.png\" data-orig-size=\"1568,654\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Index Properties\" data-image-description=\"&lt;p&gt;Index Properties&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Index Properties&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/index-1024x427.png\" class=\"wp-image-3548\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/index.png?resize=500%2C209&#038;ssl=1\" alt=\"Index Properties\" width=\"500\" height=\"209\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/index.png?resize=300%2C125&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/index.png?resize=1024%2C427&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/index.png?resize=768%2C320&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/index.png?resize=1536%2C641&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/index.png?w=1568&amp;ssl=1 1568w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3548\" class=\"wp-caption-text\"><strong>Index Properties<\/strong><\/figcaption><\/figure>\n<p>The <em><strong>\u201cDocumentCount\u201d<\/strong><\/em> property tells us how many documents have been stored in the database. The <em><strong>\u201cItemCount\u201d<\/strong><\/em> property tells us the number of chunks created for our text. The <em><strong>\u201cLabel\u201d<\/strong><\/em> property returns a list of the labels for each chunk in the database.<\/p>\n<p>OK, how do we search for some text in this database? Let us ask the system how many remedies have <em><strong>&#8220;sweet craving&#8221;<\/strong><\/em>? And which remedy has <em><strong>&#8220;aggravation from sweets&#8221;<\/strong><\/em>?<\/p>\n<figure id=\"attachment_3549\" aria-describedby=\"caption-attachment-3549\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3549\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2024\/11\/09\/semantic-search-in-wolfram-mathematica\/search1\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search1.png\" data-orig-size=\"1570,274\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Searching the Index\" data-image-description=\"&lt;p&gt;Searching the Index&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Searching the Index&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search1-1024x179.png\" class=\"wp-image-3549\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search1.png?resize=500%2C87&#038;ssl=1\" alt=\"Searching the Index\" width=\"500\" height=\"87\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search1.png?resize=300%2C52&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search1.png?resize=1024%2C179&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search1.png?resize=768%2C134&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search1.png?resize=1536%2C268&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search1.png?w=1570&amp;ssl=1 1570w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3549\" class=\"wp-caption-text\"><strong>Searching using the Index<\/strong><\/figcaption><\/figure>\n<p>The answers are correct! Both <em><strong>Lycopodium<\/strong><\/em> and <em><strong>Argentum Nitricum<\/strong><\/em> have desire for sweets. And <em><strong>Argentum Nitricum<\/strong><\/em> patients typically have some aggravation from sweets.<\/p>\n<p>What if we want to add some more text to this database and create an updated index? That is easy:<\/p>\n<figure id=\"attachment_3550\" aria-describedby=\"caption-attachment-3550\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/updateindex.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3550\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2024\/11\/09\/semantic-search-in-wolfram-mathematica\/updateindex\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/updateindex.png\" data-orig-size=\"1564,570\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Adding More Text\" data-image-description=\"&lt;p&gt;Adding More Text&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Adding More Text&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/updateindex-1024x373.png\" class=\"wp-image-3550\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/updateindex.png?resize=500%2C182&#038;ssl=1\" alt=\"Adding More Text\" width=\"500\" height=\"182\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/updateindex.png?resize=300%2C109&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/updateindex.png?resize=1024%2C373&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/updateindex.png?resize=768%2C280&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/updateindex.png?resize=1536%2C560&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/updateindex.png?w=1564&amp;ssl=1 1564w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3550\" class=\"wp-caption-text\"><strong>Adding More Text<\/strong><\/figcaption><\/figure>\n<p>We use the function <em><strong>\u201cUpdateSemanticSearchIndex\u201d<\/strong><\/em> for this. To use this, I am passing the third text fragment and specify the same chunking limits as earlier.<\/p>\n<p>You can now see that the number documents is 3 and 5 more chunks have been created for <em><strong>Natrum Muriaticum<\/strong><\/em>.<\/p>\n<p>Let us do another search with the new remedy added. We know that <em><strong>Natrum Muriaticum<\/strong><\/em> patients have an affinity for salt. Let us check this:<\/p>\n<figure id=\"attachment_3551\" aria-describedby=\"caption-attachment-3551\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3551\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2024\/11\/09\/semantic-search-in-wolfram-mathematica\/search2\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search2.png\" data-orig-size=\"1562,130\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Searching Updated Index\" data-image-description=\"&lt;p&gt;Searching Updated Index&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Searching Updated Index&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search2-1024x85.png\" class=\"wp-image-3551\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search2.png?resize=500%2C42&#038;ssl=1\" alt=\"Searching Updated Index\" width=\"500\" height=\"42\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search2.png?resize=300%2C25&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search2.png?resize=1024%2C85&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search2.png?resize=768%2C64&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search2.png?resize=1536%2C128&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/11\/search2.png?w=1562&amp;ssl=1 1562w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3551\" class=\"wp-caption-text\"><strong>Searching Updated Index<\/strong><\/figcaption><\/figure>\n<p>The search function correctly returns the remedy label. That is good!<\/p>\n<p>The above three functions in the latest release of <em><strong>Wolfram<\/strong><\/em> are quite useful for doing semantic search on text. It is easy to extend the example to work with larger documents and persisting the database in the local file system, or in the cloud.<\/p>\n<p>Have a nice weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In an earlier article, I explained how to use OpenAI from Wolfram Mathematica ver 14.1. This latest release of Wolfram supports Semantic Search as well. In today\u2019s article, let me discuss this feature. As in the case of using LLMs, using Semantic Search requires an account with one of the supported vendors. I will continue [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[72,107,388,17],"tags":[407,408],"class_list":["post-3545","post","type-post","status-publish","format-standard","hentry","category-mathematica","category-natural-language-processing","category-openai","category-programming","tag-semantic-search","tag-wolfram-mathematica"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-Vb","jetpack-related-posts":[{"id":3514,"url":"https:\/\/www.rangakrish.com\/index.php\/2024\/10\/02\/using-openai-from-mathematica-part-2\/","url_meta":{"origin":3545,"position":0},"title":"Using OpenAI from Mathematica: Part-2","author":"admin","date":"October 2, 2024","format":false,"excerpt":"I had written an earlier article\u00a0showing how to use OpenAI models from Mathematica ver 14.0.\u00a0 Wolfram Mathematica ver 14.1 was released recently, with several improvements in the area of LLMs. Of course, there are many other core additions as well, but our focus is on LLMs in this article. This\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"LLMSynthesize Function","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/10\/image1-300x71.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/10\/image1-300x71.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/10\/image1-300x71.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":3381,"url":"https:\/\/www.rangakrish.com\/index.php\/2024\/05\/20\/using-openai-from-mathematica\/","url_meta":{"origin":3545,"position":1},"title":"Using OpenAI from Mathematica","author":"admin","date":"May 20, 2024","format":false,"excerpt":"Mathematica was among the first to integrate with OpenAI. The functionality is nicely exposed in terms of a few pre-defined functions. Let us explore some of the functionality in today\u2019s article. The simplest way to get started is to use LLMSynthesize\u00a0function: It can take a few seconds before you get\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"LLMSynthesize Function","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/05\/Example1-300x27.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/05\/Example1-300x27.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2024\/05\/Example1-300x27.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":3794,"url":"https:\/\/www.rangakrish.com\/index.php\/2025\/08\/19\/stock-analysis-with-wolfram-mathematica-part-2\/","url_meta":{"origin":3545,"position":2},"title":"Stock Analysis with Wolfram Mathematica &#8211; Part 2","author":"admin","date":"August 19, 2025","format":false,"excerpt":"In the previous article, I had explained how to get started using Wolfram Mathematica\u2019s stock analysis features. The focus was on working with the exchanges supported by Mathematica, for example BSE India. What if we have stock data from a different source and want to analyze it in Mathematica? In\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"Loading the CSV Data","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/08\/processdata-fn-300x149.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/08\/processdata-fn-300x149.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/08\/processdata-fn-300x149.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":2131,"url":"https:\/\/www.rangakrish.com\/index.php\/2020\/09\/13\/mathematica-using-textcases-to-extract-information-from-natural-language-text\/","url_meta":{"origin":3545,"position":3},"title":"Mathematica: Using TextCases to Extract Information from Natural Language Text\u00a0","author":"admin","date":"September 13, 2020","format":false,"excerpt":"Extracting meaningful information from unstructured, human readable text is a hot topic of research today and has important applications in many domains. I have written a few blogs related to this topic, for example, see this\u00a0and this. In today\u2019s article, I would like to show how Mathematica can be a\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"Extracting Sentences","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/09\/ex1-2-300x106.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3830,"url":"https:\/\/www.rangakrish.com\/index.php\/2025\/10\/31\/analysing-weather-data-using-wolfram-mathematica\/","url_meta":{"origin":3545,"position":4},"title":"Analysing Weather Data Using Wolfram Mathematica","author":"admin","date":"October 31, 2025","format":false,"excerpt":"If you are interested in analysing weather data and making predictions such as rainfall, storm, etc., then Mathematica has nice functionality that you can use. In this article, let me cover a few basic functions in this category. Let us start by getting the coordinates of the place for which\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"Getting Location Coordinates","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/10\/coord-300x50.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3774,"url":"https:\/\/www.rangakrish.com\/index.php\/2025\/08\/04\/stock-analysis-using-wolfram-mathematica\/","url_meta":{"origin":3545,"position":5},"title":"Stock Analysis Using Wolfram Mathematica","author":"admin","date":"August 4, 2025","format":false,"excerpt":"I have my own toolkit for analyzing stocks, but occasionally I use Mathematica as well. Given Mathematica\u2019s extensive support for numerical computation including Machine Learning, it can be a valuable resource for deep analysis of the stock market. In today\u2019s article, let me give an overview of some of the\u2026","rel":"","context":"In &quot;Mathematica&quot;","block_context":{"text":"Mathematica","link":"https:\/\/www.rangakrish.com\/index.php\/category\/mathematica\/"},"img":{"alt_text":"Supported Exchanges","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/08\/exchanges-300x28.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/08\/exchanges-300x28.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/08\/exchanges-300x28.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/comments?post=3545"}],"version-history":[{"count":0,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3545\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=3545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=3545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=3545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}