<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Evgenii Basmov</title>
    <description>The latest articles on DEV Community by Evgenii Basmov (@coykto).</description>
    <link>https://dev.to/coykto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1064919%2F51b67f8e-3e30-43fd-8ea6-cdb4b5f7751a.jpg</url>
      <title>DEV Community: Evgenii Basmov</title>
      <link>https://dev.to/coykto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/coykto"/>
    <language>en</language>
    <item>
      <title>Analyze This: In-Depth Multi-Categorical Analysis of Competitors' Customer Reviews with ChatGPT API in Record Time</title>
      <dc:creator>Evgenii Basmov</dc:creator>
      <pubDate>Tue, 02 May 2023 09:51:38 +0000</pubDate>
      <link>https://dev.to/coykto/analyze-this-in-depth-multi-categorical-analysis-of-competitors-customer-reviews-with-chatgpt-api-in-record-time-473e</link>
      <guid>https://dev.to/coykto/analyze-this-in-depth-multi-categorical-analysis-of-competitors-customer-reviews-with-chatgpt-api-in-record-time-473e</guid>
      <description>&lt;p&gt;I want to share details of the application of ChatGPT API for parsing, analyzing, and summarizing competitors' customer reviews.&lt;/p&gt;

&lt;p&gt;My friend &lt;a href="https://www.linkedin.com/in/anna-dormeneva/"&gt;Anna Dormeneva&lt;/a&gt; works in a marketing research company, called &lt;a href="https://www.linkedin.com/company/hints-consuling/"&gt;HINTS&lt;/a&gt;. One of their clients, a prominent ed-tech company offering "English as a Foreign Professional Language'' courses, wanted to know what people thought about their competitors and how they could get ahead. Among other things, Anna, the research team leader on the project, decided to analyze customer reviews from various review aggregators.&lt;/p&gt;

&lt;p&gt;As someone who enjoys experimenting with OpenAI and Huggingface APIs in my downtime, I sensed an opportunity when I heard about the challenge of finding someone capable of analyzing thousands of reviews both quickly and consistently. And just like that, I knew what my long Easter weekend would be about.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1npK5fRQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c35nt04rsv2y66kjo80c.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1npK5fRQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c35nt04rsv2y66kjo80c.jpg" alt="ChatGPT so hot right now!" width="620" height="496"&gt;&lt;/a&gt;&lt;br&gt;
Here's how you do reviews analysis manually:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cAU7YSP1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h250ir4i1lbjlr4n8uz1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cAU7YSP1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h250ir4i1lbjlr4n8uz1.png" alt="Manual review analysis process" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Decide what review aggregators you're going to parse.&lt;/li&gt;
&lt;li&gt;Write parsers for each review aggregator website. Libraries like Scrapy, beautifulsoup4, or Selenium will help you a lot, but you still have to figure out XPaths on your own.&lt;/li&gt;
&lt;li&gt;Come up with some aspects of analysis as well as go through a bunch of reviews to see what people mention to decide what categories your analysis is going to use (like, "mobile app availability", or "refund policy", etc)&lt;/li&gt;
&lt;li&gt;MOST EXCITING PART: go through hundreds of reviews and try to analyze each according to your chosen categories. Try to keep up the quality of your analysis.&lt;/li&gt;
&lt;li&gt;Aggregate the results in a spreadsheet and draw graphs and conclusions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every step in this process can be delegated to an LLM. In my case, it was the ChatGPT API. If I'm not mistaken, it was still a gpt-3.5-turbo model.&lt;/p&gt;

&lt;p&gt;Here's the overview of the AI-powered process:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GRw4PM4z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qd1i2s4styvwqa7cqpv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GRw4PM4z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qd1i2s4styvwqa7cqpv.png" alt="Semi-automated review analysis process" width="800" height="415"&gt;&lt;/a&gt;&lt;br&gt;
As you can see, there are still humans in the picture. They are there to make conclusions and to check whether the analysis aspects the machine suggests are actually relevant to us. I guess further development might help in automating that as well.&lt;/p&gt;

&lt;p&gt;I wanted to just run an app, type in the company name and get thousands of parsed and analyzed reviews on that company service. The prototype I was building was concentrating on solving one particular problem of analyzing customer reviews on courses. The approach to different industries and business domains also can be included in further research and development.&lt;/p&gt;

&lt;p&gt;When I type in a company name, the app uses Google to search for "${companyName} reviews". Then we need to solve a problem of parsing reviews from HTML we never saw and therefore don't have a parser ready. Here's how ChatGPT might help:&lt;/p&gt;

&lt;p&gt;I take HTML and divide it into a few pieces, each of which must fit into the model context window and is likely to contain what I'm looking for - customer reviews. Then I send those pieces to ChatGPT with a prompt asking it to construct an XPath expression for retrieving reviews. Having a number of candidates for the XPath expression I use them to try to get reviews from the HTML I have and with some statistical magic, I usually get the right one and all the reviews from the page.&lt;/p&gt;

&lt;p&gt;Of course, it is not always that simple, because some review aggregators only show "review previews" and a button "Read full review", they change HTML selectors on the fly, and try to come up with unparsable pagination. I don't have perfect solutions for those problems, but it's only a prototype, of course, there is a lot of work ahead!&lt;/p&gt;

&lt;p&gt;After we get all the reviews we can take a few samples and ask ChatGPT to come up with categories of analysis. This is a semi-automatic process since we want a person to decide on the final list of aspects. In this case, it was:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Teaching approach&lt;/li&gt;
&lt;li&gt;Platform convenience&lt;/li&gt;
&lt;li&gt;Course program&lt;/li&gt;
&lt;li&gt;Mobile app availability&lt;/li&gt;
&lt;li&gt;Price&lt;/li&gt;
&lt;li&gt;Teacher quality&lt;/li&gt;
&lt;li&gt;Cancellation/rescheduling policy&lt;/li&gt;
&lt;li&gt;Studying materials quality&lt;/li&gt;
&lt;li&gt;Customer service&lt;/li&gt;
&lt;li&gt;Course effectiveness&lt;/li&gt;
&lt;li&gt;Course duration&lt;/li&gt;
&lt;li&gt;Course schedule&lt;/li&gt;
&lt;li&gt;Marketing&lt;/li&gt;
&lt;li&gt;Speaking practice&lt;/li&gt;
&lt;li&gt;Homework&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When we are happy with the categories list we analyze every review based on the list.&lt;/p&gt;

&lt;p&gt;Example of a review:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GpBqmE2p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vp5s3l2evue3fcszhgqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GpBqmE2p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vp5s3l2evue3fcszhgqw.png" alt="Example of customer review" width="800" height="733"&gt;&lt;/a&gt;&lt;br&gt;
Its analysis result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
   "review": "review text...",
   "analysis": {
       "teaching approach": {
           "sentiment": "0",
           "context": ""
       },
       "platform convenience": {
           "sentiment": "1",
           "context": "I really like the vocabulary-trainer, diverse lessons"
       },
       "course program": {
           "sentiment": "0",
           "context": ""
       },
       "mobile app availability": {
           "sentiment": "0",
           "context": ""
       },
       "price": {
           "sentiment": "-1",
           "context": "Cannot reschedule lessons on a more budget-friendly plan"
       },
       "teacher quality": {
           "sentiment": "1",
           "context": "I like the teacher, she also has a cat ^_^"
       },
       "cancellation/rescheduling policy": {
           "sentiment": "0",
           "context": ""
       },
       "studying materials quality": {
           "sentiment": "1",
           "context": "There's also a great course on tenses that I bought separately. It changed my understanding of how tenses are used and how they work in the language."
       },
       "customer service": {
           "sentiment": "0",
           "context": ""
       },
       "course effectiveness": {
           "sentiment": "1",
           "context": "The lessons are a great distraction from my routine and work because I have to talk a lot, so my brain gets a workout"
       },
       "course duration": {
           "sentiment": "0",
           "context": ""
       },
       "course schedule": {
           "sentiment": "1",
           "context": "It's also great that the lessons are at a convenient time for me. That was one of the main criteria for me, to find a schedule that works for me."
       },
       "marketing": {
           "sentiment": "0",
           "context": ""
       },
       "speaking practice": {
           "sentiment": "1",
           "context": "The lessons are a great distraction from my routine and work because I have to talk a lot"
       },
       "homework": {
           "sentiment": "1",
           "context": "the variety of homework assignments (there are listening exercises, grammar tasks, listening without transcription, and then the teacher opens it up)"
       }
   }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Based on all results we can take one category, take all the context related to that category and ask ChatGPT to summarize the analysis of it.&lt;/p&gt;

&lt;p&gt;The prompt I used looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
  {
    "role": "system", 
    "content": (
       f"You analyze customer reviews of an online language course. "
       f"You will be given an aspect of analysis, and a list of results, consisting of sentiment and context. "
       f"You will be asked to summarize the results."
    )
  },{
    "role": "user", 
    "content": f"Point of analysis is: {point_name}. Results:\n{points}"
  }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result looks something like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The analysis of the reviews shows that the majority of users have positive feedback about the homework in the online course. They find it convenient to do homework in the app, which it can be done on any device, and to learn new words. Many users note that homework can be done anywhere and at any convenient time. Users also appreciate the variety of tasks and materials, and the ability to choose the volume of homework and complete it according to their level of knowledge. Some users express dissatisfaction with certain aspects, such as unclear audio texts or an underdeveloped mobile application. However, overall, the homework in the online course has received positive reviews.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the end, we end up with a high-quality analysis of hundreds of customer reviews in just a few hours at most, whereas the manual process would take us around 120 hours of very inconsistent and likely less-quality results.&lt;/p&gt;

&lt;p&gt;I exported everything in Excel format so &lt;a href="https://www.linkedin.com/in/anna-dormeneva/"&gt;Anna&lt;/a&gt; could create some graphs for use in a presentation for a client. Combined with other things Anna's team did, the project was a resounding success!&lt;/p&gt;

</description>
      <category>marketing</category>
      <category>ai</category>
      <category>programming</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>Dancing with Spaghetti: Managing Real-World Complexity for Coding Wizards</title>
      <dc:creator>Evgenii Basmov</dc:creator>
      <pubDate>Tue, 18 Apr 2023 08:15:49 +0000</pubDate>
      <link>https://dev.to/coykto/dancing-with-spaghetti-managing-real-world-complexity-for-coding-wizards-3871</link>
      <guid>https://dev.to/coykto/dancing-with-spaghetti-managing-real-world-complexity-for-coding-wizards-3871</guid>
      <description>&lt;p&gt;Arguing about programming paradigms is like debating the best way to eat spaghetti – everyone has their preferred method, but in the end, we're all just trying to untangle a messy, saucy problem.&lt;/p&gt;

&lt;p&gt;I believe all those arguments about coding paradigms, ideologies, and styles are fundamentally based on people's misconception that their code can somehow decrease the complexity of the problem they're trying to solve.&lt;/p&gt;

&lt;p&gt;In one of many YouTube videos on the topic of why OOP is bad, there's a &lt;a href="https://www.youtube.com/watch?v=QM1iUe6IofM" rel="noopener noreferrer"&gt;video&lt;/a&gt; with millions of views where the author (Brian Will) poses a question towards the end:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Are we actually decreasing the total complexity of our program by splitting code into many small methods and separate classes, or are we just displacing the complexity, merely spreading it around?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;He's right to notice that structuring a program with objects doesn't help to decrease the total complexity, but I would argue that it's impossible regardless of the way you code.&lt;br&gt;
Don't get me wrong; you could easily increase the complexity if you're not careful, but that doesn't have anything to do with your paradigm of choice. I'm sure people have already come up with all kinds of &lt;a href="https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition" rel="noopener noreferrer"&gt;FizzBuzzEnterpriseEdition&lt;/a&gt; using different styles and approaches.&lt;/p&gt;

&lt;p&gt;I think Brian and most people who keep bringing up these arguments don't understand one simple thing: our profession is not about complexity minimization; it's complexity management.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy24c81pp4173y5jr57zc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy24c81pp4173y5jr57zc.png" alt="Engineer Aang."&gt;&lt;/a&gt;I like to think about programming as “Complexity Bending”&lt;br&gt;
We take a problem and shift and displace its complexity in a way that is useful for us. We can use libraries and tools like databases, message queues, and schedulers to delegate some aspects of a problem to them, but the complexity that, for example, a database helps us deal with doesn't go anywhere. The database developers had to manage the complexity of data storage, accessing, availability, and so on.&lt;/p&gt;

&lt;p&gt;So, if OOP or any other approach helps you and your team better understand the problem and manage its complexity, good for you. But if you hope to reduce the problem's complexity, not just manage it, then you're going to work in a very frustrating environment, because what you want to achieve is simply not possible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnpuvbaegecztvm2kh5kl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnpuvbaegecztvm2kh5kl.png" alt="American Psycho"&gt;&lt;/a&gt;&lt;br&gt;
Instead of devoting yourself to some "school of thought," you probably should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Break down problems into smaller, more manageable pieces. This is very trivial, yet when this idea gets named the "Single Responsibility Principle" and "Dependency Injection," some people grab their pitchforks. My theory is that this happens because people are introduced to these ideas before they have enough real-world experience to connect them to the base idea of breaking down problems. They think it is some complication "gatekeepers" came up with just to complicate their CS exams this semester. As with many things in life, if deep down you don't feel like you need it, don't bother. Don't use SRP or DI until you need them. Just keep them on your radar. And when you eventually feel you need them, don't be shy to rely on them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While some might see microservices, modularity, and serverless code as a sneaky way to make developers replaceable, the truth is, there's a lot more to it than just fulfilling management's dark fantasies. Sure, it might help with that too. But, it also means you can more easily hop between jobs or projects without getting stuck in the mire of "job security" (a.k.a. spaghetti code). Let's face it, who wouldn't prefer working with code that's a breeze to understand and maintain? It might not be as thrilling as untangling a complex web of interdependent modules, but it sure beats needing a degree in archaeology just to figure out how the darn thing works.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update your README. Ah, documentation – the forgotten stepchild of programming, locked away in the attic. We've evolved as a society enough to only approve merge requests with unit tests, but when it comes to documentation, it's often "oh, yeah, we don't keep it up-to-date." Yikes! What was I thinking, attempting to follow the README instructions to deploy the app locally? Let's be real: getting to know a codebase is like navigating a foreign city. Sure, you can find the nearest Starbucks, but try doing it with a map from the 1800s.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Subpar software artifacts often result from stubbornly sticking to convoluted algorithms, whereas embracing the KISS principle usually leads to a decrease in cognitive load and a corresponding boost in system sturdiness. In simpler terms: if you care about something, don't overcomplicate it. I know it's tempting to craft a one-liner using just a smattering of symbols, but let's fight that urge, shall we?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In summary, throw yourself a complexity party! Transform into a programming wizard who conjures up a "do it" button for those who thrive in other realms, like business, medical research, finance, etc. You'll enrich their lives by harnessing your passion for technical solutions and mastery over complexity.&lt;/p&gt;

&lt;p&gt;So, stop the endless fights over programming paradigms and embark on an all-you-can-learn buffet, sampling knowledge from various sources that can prove helpful in different circumstances. Remember, it's not about reducing complexity – it's about embracing it and taming the wild beast to create a better world for you and others!&lt;/p&gt;

&lt;p&gt;And, as you set off on this journey, never forget the immortal words of Albert Einstein: "Everything should be made as simple as possible, but not simpler." In the world of programming, that means accepting that complexity will always be a part of the job, but we can choose to dance with it rather than fight against it. Now, go out there and show that complexity who's boss!&lt;/p&gt;

</description>
      <category>programming</category>
      <category>discuss</category>
      <category>career</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
