<?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>Forem: Brenda .. </title>
    <description>The latest articles on Forem by Brenda ..  (@b-qt).</description>
    <link>https://forem.com/b-qt</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%2F431349%2F07f88f4f-345c-438f-be8e-33ed2f623f8e.png</url>
      <title>Forem: Brenda .. </title>
      <link>https://forem.com/b-qt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/b-qt"/>
    <language>en</language>
    <item>
      <title>Rebuilding the national narrative with AI and Docker</title>
      <dc:creator>Brenda .. </dc:creator>
      <pubDate>Tue, 21 Apr 2026 10:50:34 +0000</pubDate>
      <link>https://forem.com/b-qt/rebuilding-the-national-narrative-with-ai-and-docker-16jj</link>
      <guid>https://forem.com/b-qt/rebuilding-the-national-narrative-with-ai-and-docker-16jj</guid>
      <description>&lt;p&gt;Whether you’re a &lt;strong&gt;Founder&lt;/strong&gt; in the 22@ district trying to track market shifts, or a &lt;strong&gt;Tech Enthusiast&lt;/strong&gt; looking for your first break in the industry, the problem is identical: &lt;em&gt;the "Information Sludge."&lt;/em&gt; Every day, Spain generates headlines across Finance, Tech, and Real Estate. &lt;br&gt;
Most of it is noise... I want the signal.&lt;/p&gt;

&lt;p&gt;So I built a refinery.&lt;/p&gt;

&lt;p&gt;The refinery isn't just to "scrape news". I want to build an automated engine that reads the national sentiment, distilling it into actionable insights.&lt;/p&gt;




&lt;h2&gt;
  
  
  🍽️  The "Data Kitchen" Architecture
&lt;/h2&gt;

&lt;p&gt;To explain this to my non-tech friends, I tell them to imagine a high-end restaurant in Poblenou:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Ingestion (Mage AI): My Head Chef... Every 6 hours, he hits the digital markets (Google News) to find the freshest raw ingredients.&lt;/li&gt;
&lt;li&gt;The Brain (Robertuito NLP): My Specialist Saucier... This is a specialized AI model trained on native Spanish text. It doesn't just "read"; it understands the cultural nuance to detect if the "vibe" is Positive, Neutral, or Negative.&lt;/li&gt;
&lt;li&gt;The Transformation (dbt): My Bouncer. He runs integrity tests. If a headline is a duplicate or a "ghost" with no link, it doesn't get past the velvet rope.&lt;/li&gt;
&lt;li&gt;The Showroom (Streamlit): My Waiter. He serves the final, high-purity insights on interactive charts.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🏗️ For the Docker Wizards: Forging the "Steel"
&lt;/h2&gt;

&lt;p&gt;If you live in the terminal, you know that "Integrity" isn't a buzzword—it’s a configuration. Building this refinery required overcoming some hurdles that nearly melted my CPU.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The Cartesian Explosion (The "Freeze" Bug) 🧊&lt;br&gt;
Early on, I joined my raw data to my "date spine" too early in the pipeline. It created a Cartesian product that multiplied rows exponentially. It was like trying to fit the entire crowd of a Barça match into a single tiny bar in the Raval.&lt;br&gt;
The Fix: Pre-Aggregation. I moved a lot of the "cooking" into CTEs, shrinking the data to its daily grain before the joins. The machine finally stopped freezing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Docker Path Labyrinth (The GPS Mismatch) 🧭&lt;br&gt;
Containers are isolated worlds. My code was looking for database files in a local Barcelona folder, while the container was sitting in its own "Virtual Madrid."&lt;br&gt;
The Fix: Absolute Path Sovereignty. I enforced deterministic paths starting from the root (/home/src/). The system is now self-healing; if the environment resets, the refinery knows exactly how to rebuild its own infrastructure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Runtime vs. Build-time War ⚔️&lt;br&gt;
Installing heavy AI libraries like PyTorch every time the container started made the "cold start" slower than a siesta in August.&lt;br&gt;
The Fix: I shifted from runtime installation to Build-time Provisioning. By "baking" the heavy dependencies into the Docker image, the refinery is now Ready to Serve the second it turns on.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;In Data Engineering, your Lineage Graph is your bond. Inspired by the principle of being an "ensample in purity," I codify my ethics into the SQL.&lt;/p&gt;

&lt;p&gt;By using TRY_CAST and NULLIF patterns, I neutralized data "sludge" (like literal 'null' strings in CSVs) before it poisons the metrics. I standardized codes and fix typos. &lt;br&gt;
Why? Because Clean Data is the highest form of professional honesty.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 The Roadmap: What’s Next?
&lt;/h2&gt;

&lt;p&gt;I have set a deadline to land my next role here in Barcelona, and the refinery is my primary proof of work. But a true architect never stops building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Market Deep-Listening: Expanding the "Loophole Ingestor" to catch specific industrial shifts, predicting economic trends before they hit the mainstream.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🏁 The Bottom Line
&lt;/h2&gt;

&lt;p&gt;I didn’t just build a dashboard; I built an engine. In a world of fake news and fragmented data, the Spanish Pulse is a reminder that we can use technology to find the truth—and have a little Joie de Vivre while doing it.&lt;/p&gt;

&lt;p&gt;Check out the &lt;a href="https://github.com/b-qt/news-monitor/blob/main/README.md" rel="noopener noreferrer"&gt;repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dataengineering</category>
      <category>python</category>
      <category>opensource</category>
      <category>docker</category>
    </item>
    <item>
      <title>Analysis of a Reviews dataset</title>
      <dc:creator>Brenda .. </dc:creator>
      <pubDate>Mon, 11 Dec 2023 16:00:03 +0000</pubDate>
      <link>https://forem.com/b-qt/analysis-of-a-reviews-dataset-15lc</link>
      <guid>https://forem.com/b-qt/analysis-of-a-reviews-dataset-15lc</guid>
      <description>&lt;p&gt;Looking through kaggle, there's a lot of projects you and I can do when deeping your feet into the scary world of data science. Of all the datasets, discussions and notebooks on the platform is the &lt;em&gt;Amazon Reviews&lt;/em&gt; dataset; but alas why take a project without an understanding of future deliverables, defining project process.&lt;br&gt;&lt;br&gt;
In undertaking this project, I wondered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why is this project important?&lt;/li&gt;
&lt;li&gt;How will this project help in the real-world? &lt;/li&gt;
&lt;li&gt;What does a potential employer see by adding this project to my portfolio? What do I want them to see? &lt;/li&gt;
&lt;li&gt;How do I showcase this project in my portfolio? &lt;/li&gt;
&lt;li&gt;What is the main takeaway from this project for myself, and anyone who comes across it?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Defining the project
&lt;/h3&gt;

&lt;p&gt;By defining the project, we are able to manage expectations, set a time frame and plan steps to execute the project. Generally, for most data projects, the outline is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data collection and Initial analysis&lt;/li&gt;
&lt;li&gt;Pre-processing&lt;/li&gt;
&lt;li&gt;Feature Extraction&lt;/li&gt;
&lt;li&gt;Model selection and Evaluation &lt;/li&gt;
&lt;li&gt;Deployment
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm not looking to re-invent the wheel so I'm using the same approach. &lt;/p&gt;

&lt;h3&gt;
  
  
  Process
&lt;/h3&gt;

&lt;p&gt;For this project, the &lt;strong&gt;data is taken&lt;/strong&gt; from &lt;a href="https://drive.google.com/file/d/0Bz8a_Dbh9QhbZVhsUnRWRDhETzA/view?resourcekey=0-Rp0ynafmZGZ5MflGmvwLGg" rel="noopener noreferrer"&gt;amazon reviews data source&lt;/a&gt;; in the source, the data was split into train and test files but I merged them to be more random.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fy620bpgzm5xz6dlus6yc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fy620bpgzm5xz6dlus6yc.png" alt="Loading the data" width="576" height="279"&gt;&lt;/a&gt;&lt;br&gt;
Looking through the data, I realized there were 6 columns; 2 numerical and the other 4 having text which I noticed were split reviews.&lt;/p&gt;

&lt;p&gt;To &lt;strong&gt;preprocess the data&lt;/strong&gt;, I merged the textual data into a single review and got a singular rating value for each review.&lt;br&gt;
&lt;a href="https://media2.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%2Fre1j4agef3v9owpa6fes.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fre1j4agef3v9owpa6fes.png" alt="Data Preprocessing" width="576" height="261"&gt;&lt;/a&gt;&lt;br&gt;
I was interested in &lt;em&gt;looking at the general ratings&lt;/em&gt; and &lt;em&gt;identifying the main topic of each review&lt;/em&gt;. &lt;br&gt;
But why will this knowledge be important? Who will need insights such as this? &lt;em&gt;Retailers need to understand what products are being sold and what aren't&lt;/em&gt;. It would have been more insightful to have information about locations to better help the retailers but alas such data wasn't added to the dataset.&lt;/p&gt;

&lt;p&gt;After preparing the data, the next step was to get the topics from the sentiments (&lt;em&gt;Feature Extraction&lt;/em&gt;). &lt;/p&gt;

&lt;p&gt;HuggingFace is known for its Transformers Python library, which simplifies the process of downloading and training machine learning models. I used 2 of these models to 'predict' the ratings of the reviews and compare the reviews to the provided review.&lt;br&gt;
To evaluate the models' predictions, I employed an evaluate_models function.&lt;br&gt;
&lt;a href="https://media2.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%2F9cijw0zx1tsx5g810cq1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9cijw0zx1tsx5g810cq1.png" alt="Evaluate Models" width="592" height="217"&gt;&lt;/a&gt;&lt;br&gt;
I found out that the autoTokenizer is less accurate compared to huggingFace's distilbert; regardless, I left the model in there as a visible lesson.&lt;/p&gt;

&lt;p&gt;Finally, use CountVectorizer to convert text data into numerical representations that can be understood by machine learning models. CountVectorizer tokenizes the text, removing basic english words, and then builds a vocabulary of known words. This technique is used to create a fixed-length vector of numbers representing the occurrences of words in the text.&lt;br&gt;
After vectorizing the data, I used LDA, NMF and SVD to &lt;strong&gt;get topics from each review&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media2.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%2F7x302dq4mp4eavihlpcw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7x302dq4mp4eavihlpcw.png" alt="Topic Extraction" width="577" height="409"&gt;&lt;/a&gt;&lt;br&gt;
From the columns generated, I generated another &lt;em&gt;column of common topics&lt;/em&gt; to all columns from the topic extraction.&lt;br&gt;
&lt;a href="https://media2.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%2Fbrqh288ucbqioyjc6q03.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fbrqh288ucbqioyjc6q03.png" alt="Common Topics" width="471" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Generating these columns makes me want to actually &lt;em&gt;look at these&lt;/em&gt; ratings and their topics.&lt;br&gt;
The data we ended up with after all this manipulation looks like this:&lt;br&gt;
&lt;a href="https://media2.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%2F0pv5d4eetndu7kfrulzj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0pv5d4eetndu7kfrulzj.png" alt="Final data" width="800" height="241"&gt;&lt;/a&gt;&lt;br&gt;
And from the data, these charts were produced&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F57ss7kmk8g9rgu7zi6uo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F57ss7kmk8g9rgu7zi6uo.png" alt="Common Topics and Ratings" width="729" height="1325"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fivy43d1c1g58shf202pk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fivy43d1c1g58shf202pk.png" alt="Common Topics and Average Ratings" width="800" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenges
&lt;/h3&gt;

&lt;p&gt;While working on this project, I faced an issue of too much data. The data was hard to manipulate due to it's volume.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To overcome this, I sampled the data then implemented concurrency on batches of the samples. &lt;em&gt;Concurrency handles the complexity of multi-threading and multi-processing and enables asynchronous execution and results&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Lessons learned
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;As a data scientist, we are accustomed to working in notebooks rather than working in scripts. But in the current day and age, the data scientist is to be familiar and comfortable with writing and working with scripts. &lt;/li&gt;
&lt;li&gt;Before commencing a project, &lt;em&gt;especially a portfolio project&lt;/em&gt;, think about what you want to showcase, what you are learning and always practice time management. And be sure to look at the data and think of where this data is coming from _ in the future where would this data come from, who is going to collect this data _; then think of how this can be automated.&lt;/li&gt;
&lt;li&gt;What is your final product? Where is it? What about updates? I chose to deploy the results on &lt;a href="https://amazonreviews-prediction.streamlit.app/" rel="noopener noreferrer"&gt;streamlit&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Future progress
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In the future, I want to pull data from an api. In that case the data will be more relevant and could include other attributes such as location which will be important to the retailers. The model will be updated accordingly.&lt;/li&gt;
&lt;li&gt;In case I use an api, then I could use apache airflow to build a pipeline which automates this via a dag in a script.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;These are my thoughts about a beginner project in data science tackling data analysis in python and sentiment analysis of an amazon reviews dataset collected over the span of 18 years. These thoughts would be relevant to a beginner data scientist or someone wanting to get into the data science field.&lt;br&gt;
Hopefully, you learnt something from my ramblings.&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>python</category>
      <category>beginners</category>
      <category>dataanalysis</category>
    </item>
  </channel>
</rss>
