{"id":7717,"date":"2024-09-25T01:20:00","date_gmt":"2024-09-25T05:20:00","guid":{"rendered":"https:\/\/www.both.org\/?p=7717"},"modified":"2024-09-24T08:00:55","modified_gmt":"2024-09-24T12:00:55","slug":"elevating-your-writing-with-ollama-and-phi3-model-synergy","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=7717","title":{"rendered":"Elevating Your Writing with Ollama and Phi3 Model Synergy"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"7717\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p>In today\u2019s digital age, writers seek tools that enhance their craft and provide real-time feedback and assistance. Enter Ollama &#8211; an open-source machine learning system designed to democratize accessibility for natural language processing tasks across a wide range of languages and scripts with ease. Coupled with the Phi3 model, this powerful duo promises unparalleled benefits in refining your writing style through sophisticated evaluations beyond grammar checking. This article will explore how Ollama, integrated with phi3&#8217;s innovative language comprehension and assessment approach, revolutionizes the writer\u2019s journey toward excellence. So buckle up as we embark on a transformative exploration of your writing potential using these advanced AI tools!<\/p>\n\n\n\n<p>I have been experimenting with Ollama and various models designed to work with it. In this article, I wanted to use Ollama and Phi3 to demonstrate the power of open source to revolutionize and evaluate writing. Both Ollama and Phi3 are open source, both have MIT licenses, and they work well together. You need to have Ollama installed on your computer. My daily driver is an Intel NUC 11 with an i7 processor running Linux Mint Cinnamon. Though this is a powerful computer, running a large language model takes more than a great CPU. A powerful GPU would make the process a little quicker.<\/p>\n\n\n\n<p>First, I needed to make sure that Ollama was installed. If you are on Linux, you do that by executing the following code in a terminal.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ curl -fsSL https:\/\/ollama.com\/install.sh | sh<\/code><\/pre>\n\n\n\n<p>The installation is very straightforward. First, you will need to download the Phi3 model. Enter the following command into your terminal.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ollama pull phi3<\/code><\/pre>\n\n\n\n<p>This pulls the Phi3 model down to your computer. You can check to make sure it is there by entering the following code. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ollama list<\/code><\/pre>\n\n\n\n<p>You should see a list of all the models loaded on your computer. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NAME            \tID          \tSIZE  \tMODIFIED       \nphi3:latest     \t4f2222927938\t2.2 GB\t56 minutes ago\t\ncooking:latest  \t59c8496c62aa\t4.7 GB\t7 days ago    \t\nllama3.1:latest \t42182419e950\t4.7 GB\t7 days ago    \t<\/code><\/pre>\n\n\n\n<p>Now I am ready to begin. I wanted Ollama and the Phi3 model to develop a rubric to evaluate my writing sample. I need to enter two commands. First, I need to get the LLM running, which will open a REPL (Read Only Print Loop) prompt very similar to a Python REPL.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ollama run phi3:latest\n&gt;&gt;&gt; create a rubric to score college level writing. <\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>The model quickly created a rubric to score my writing some of which I have copied and pasted here: <\/p>\n\n\n\n<p>College Level Writing Rubric: Essay (20 points)<\/p>\n\n\n\n<p>I. Introduction and Thesis Statement (4\/20 = 2 points): <\/p>\n\n\n\n<p>A student&#8217;s introduction must be clear, concise, engaging, and<br>well-structured. A strong thesis statement should identify the topic of<br>discussion clearly while presenting an argument or perspective that sets<br>up a logical progression throughout the essay. Students will lose one<br>point for each instance where these two components fail to establish<br>context effectively (e.g., unclear writing style, unconvincing tone). <\/p>\n\n\n\n<p>1 Point &#8211; Clear and engaging introduction with well-structured paragraphs<br>setting the stage of discussion or argumentation<br>2 Points &#8211; Introduction is structured clearly but fails in some areas such<br>as clarity of language use or lacking an enticing hook to captivate<br>readers&#8217; interest. (Lose one point)<br>1 Point &#8211; Thesis statement presented, but lacks precision and clear<br>articulation about the topic discussed; does not establish a logical<br>thread for essay progression 2 Points &#8211; Clearly stated thesis that<br>presents argument or perspective while setting up an effective structure<br>to follow throughout. (Lose one point)<br>0 PointS &#8211; Introduction is unclear, disjointed language use fails in<br>providing context and lacks persuasive tone necessary; no clear indication<br>of what the essay will discuss<\/p>\n<\/blockquote>\n\n\n\n<p>The rubric, over seven hundred words long, was generated in a few minutes. All text output from Ollama is in MarkDown. The rubric will be rendered much quicker if you are a developer using an Apple Silicon MacBook and an M2 processor. Though exceptionally powerful, the NUC 11 with the i7 CPU lacks a GPU, which eases the strain on the CPU.<\/p>\n\n\n\n<p>Now that the rubric has been created, I entered the following command in the Ollama REPL to evaluate an article I wrote for Opensource.com nearly ten years ago. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt;Use the rubric to evaluate this article https:\/\/opensource.com\/education\/15\n... \/12\/my-open-source-story-don-watkins<\/code><\/pre>\n\n\n\n<p>The process took a few minutes and provided an in-depth review of my article.  The evaluation was very detailed and over nine hundred words long. I have pasted the first part of the review here.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>2 Points &#8211; Introduction engages with opening hook; however, lacks clarity<br>in setting the stage and doesn&#8217;t align well with Watkins\u2019 thesis statement<br>(lose up to three points) 1 Point \u2013 Thesis statement present but vague or<br>imprecise about what readers should expect throughout this article. Lacks<br>clear alignment between I and II components of essay-like structure; no<br>explicit roadmap provided for reader follow along (lose two maximum<br>points); fails in captivating the audience right from introduction<br>0 PointS &#8211; Introduction lacks coherence, disjointed language use provides<br>little context or interest to readers about open source contributions. No<br>engaging hook presented nor clear alignment between I and II components of<br>essay-like structure; does not provide explicit roadmap for reader follow<br>along (lose one point)&#8230;<\/p>\n<\/blockquote>\n\n\n\n<p>Using large language models to assess writing could offer the subtlety writers require to enhance their writing. Are there potential issues? Will artificial intelligence models replace copywriters? What other implications might they have that change how we write and re-write? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In today&rsquo;s digital age, writers seek tools that enhance their craft and provide real-time feedback and assistance. Enter<\/p>\n","protected":false},"author":32,"featured_media":2811,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[307,5,579],"tags":[578,560,577],"class_list":["post-7717","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-linux","category-writing","tag-ai-model","tag-ollama","tag-phi3"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/7717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7717"}],"version-history":[{"count":4,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/7717\/revisions"}],"predecessor-version":[{"id":7727,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/7717\/revisions\/7727"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/2811"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}