diff --git a/.gitignore b/.gitignore
index 053b56b..adada06 100644
--- a/.gitignore
+++ b/.gitignore
@@ -179,6 +179,4 @@ products_vectorstore/
# ignore diagnostics reports
**/report.txt
-# ignore optimized C++ code from being checked into repo
-week4/optimized
-week4/simple
+git_pull_information.txt
diff --git a/week1/community-contributions/day2 EXERCISE_llama_on_my_web_page.ipynb b/week1/community-contributions/day2 EXERCISE_llama_on_my_web_page.ipynb
new file mode 100644
index 0000000..40d60b0
--- /dev/null
+++ b/week1/community-contributions/day2 EXERCISE_llama_on_my_web_page.ipynb
@@ -0,0 +1,714 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "d15d8294-3328-4e07-ad16-8a03e9bbfdb9",
+ "metadata": {},
+ "source": [
+ "# Welcome to your first assignment!\n",
+ "\n",
+ "Instructions are below. Please give this a try, and look in the solutions folder if you get stuck (or feel free to ask me!)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ada885d9-4d42-4d9b-97f0-74fbbbfe93a9",
+ "metadata": {},
+ "source": [
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " | \n",
+ " \n",
+ " Just before we get to the assignment --\n",
+ " I thought I'd take a second to point you at this page of useful resources for the course. This includes links to all the slides. \n",
+ " https://edwarddonner.com/2024/11/13/llm-engineering-resources/ \n",
+ " Please keep this bookmarked, and I'll continue to add more useful links there over time.\n",
+ " \n",
+ " | \n",
+ "
\n",
+ "
"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6e9fa1fc-eac5-4d1d-9be4-541b3f2b3458",
+ "metadata": {},
+ "source": [
+ "# HOMEWORK EXERCISE ASSIGNMENT\n",
+ "\n",
+ "Upgrade the day 1 project to summarize a webpage to use an Open Source model running locally via Ollama rather than OpenAI\n",
+ "\n",
+ "You'll be able to use this technique for all subsequent projects if you'd prefer not to use paid APIs.\n",
+ "\n",
+ "**Benefits:**\n",
+ "1. No API charges - open-source\n",
+ "2. Data doesn't leave your box\n",
+ "\n",
+ "**Disadvantages:**\n",
+ "1. Significantly less power than Frontier Model\n",
+ "\n",
+ "## Recap on installation of Ollama\n",
+ "\n",
+ "Simply visit [ollama.com](https://ollama.com) and install!\n",
+ "\n",
+ "Once complete, the ollama server should already be running locally. \n",
+ "If you visit: \n",
+ "[http://localhost:11434/](http://localhost:11434/)\n",
+ "\n",
+ "You should see the message `Ollama is running`. \n",
+ "\n",
+ "If not, bring up a new Terminal (Mac) or Powershell (Windows) and enter `ollama serve` \n",
+ "And in another Terminal (Mac) or Powershell (Windows), enter `ollama pull llama3.2` \n",
+ "Then try [http://localhost:11434/](http://localhost:11434/) again.\n",
+ "\n",
+ "If Ollama is slow on your machine, try using `llama3.2:1b` as an alternative. Run `ollama pull llama3.2:1b` from a Terminal or Powershell, and change the code below from `MODEL = \"llama3.2\"` to `MODEL = \"llama3.2:1b\"`"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "4e2a9393-7767-488e-a8bf-27c12dca35bd",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# imports\n",
+ "\n",
+ "import requests\n",
+ "from bs4 import BeautifulSoup\n",
+ "from IPython.display import Markdown, display"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "29ddd15d-a3c5-4f4e-a678-873f56162724",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Constants\n",
+ "\n",
+ "OLLAMA_API = \"http://localhost:11434/api/chat\"\n",
+ "HEADERS = {\"Content-Type\": \"application/json\"}\n",
+ "MODEL = \"llama3.2\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "dac0a679-599c-441f-9bf2-ddc73d35b940",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Create a messages list using the same format that we used for OpenAI\n",
+ "\n",
+ "messages = [\n",
+ " {\"role\": \"user\", \"content\": \"Describe some of the business applications of Generative AI\"}\n",
+ "]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "7bb9c624-14f0-4945-a719-8ddb64f66f47",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "payload = {\n",
+ " \"model\": MODEL,\n",
+ " \"messages\": messages,\n",
+ " \"stream\": False\n",
+ " }"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "479ff514-e8bd-4985-a572-2ea28bb4fa40",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Let's just make sure the model is loaded\n",
+ "\n",
+ "!ollama pull llama3.2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "42b9f644-522d-4e05-a691-56e7658c0ea9",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Generative AI has numerous business applications across various industries. Here are some examples:\n",
+ "\n",
+ "1. **Content Creation**: Generative AI can generate high-quality content such as:\n",
+ "\t* Articles and blog posts\n",
+ "\t* Social media posts and captions\n",
+ "\t* Product descriptions and e-commerce content\n",
+ "\t* Music and audio tracks\n",
+ "2. **Product Design and Development**: Generative AI can assist in product design, prototyping, and development by:\n",
+ "\t* Generating 3D models and CAD designs\n",
+ "\t* Creating prototypes and mockups\n",
+ "\t* Optimizing product performance and functionality\n",
+ "3. **Marketing and Advertising**: Generative AI can help with marketing and advertising efforts by:\n",
+ "\t* Generating personalized ad copy and landing pages\n",
+ "\t* Creating social media ads and promotions\n",
+ "\t* Analyzing customer behavior and sentiment to inform marketing strategies\n",
+ "4. **Data Analysis and Visualization**: Generative AI can aid in data analysis and visualization by:\n",
+ "\t* Generating insights and recommendations from large datasets\n",
+ "\t* Creating visualizations and reports to communicate findings\n",
+ "\t* Identifying patterns and trends in complex data\n",
+ "5. **Customer Service and Support**: Generative AI can be used to power chatbots and virtual assistants that:\n",
+ "\t* Provide customer support and answer frequently asked questions\n",
+ "\t* Route customers to human representatives when needed\n",
+ "\t* Analyze customer feedback and sentiment to improve service\n",
+ "6. **Personalized Recommendations**: Generative AI can generate personalized product recommendations for e-commerce platforms, streaming services, and more.\n",
+ "7. **Content Moderation and Review**: Generative AI can assist in content moderation by:\n",
+ "\t* Analyzing online content for hate speech, harassment, or explicit material\n",
+ "\t* Generating reviews and ratings for products or services\n",
+ "8. **Supply Chain Optimization**: Generative AI can help optimize supply chains by:\n",
+ "\t* Predicting demand and inventory levels\n",
+ "\t* Identifying bottlenecks and inefficiencies in logistics and transportation\n",
+ "9. **Financial Analysis and Modeling**: Generative AI can aid in financial analysis and modeling by:\n",
+ "\t* Generating forecasts and predictions for sales, revenue, and expenses\n",
+ "\t* Analyzing financial data to identify trends and patterns\n",
+ "10. **Creative Writing and Copywriting**: Generative AI can generate high-quality creative writing and copywriting content, such as:\n",
+ "\t* Blog posts and articles\n",
+ "\t* Social media posts and captions\n",
+ "\t* Advertisements and marketing materials\n",
+ "\n",
+ "These are just a few examples of the many business applications of Generative AI. As the technology continues to evolve, we can expect to see even more innovative uses in various industries.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# If this doesn't work for any reason, try the 2 versions in the following cells\n",
+ "# And double check the instructions in the 'Recap on installation of Ollama' at the top of this lab\n",
+ "# And if none of that works - contact me!\n",
+ "\n",
+ "response = requests.post(OLLAMA_API, json=payload, headers=HEADERS)\n",
+ "print(response.json()['message']['content'])"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6a021f13-d6a1-4b96-8e18-4eae49d876fe",
+ "metadata": {},
+ "source": [
+ "# Introducing the ollama package\n",
+ "\n",
+ "And now we'll do the same thing, but using the elegant ollama python package instead of a direct HTTP call.\n",
+ "\n",
+ "Under the hood, it's making the same call as above to the ollama server running at localhost:11434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "7745b9c4-57dc-4867-9180-61fa5db55eb8",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Generative AI has numerous business applications across various industries. Here are some examples:\n",
+ "\n",
+ "1. **Content Generation**: Generative AI can be used to generate high-quality content such as articles, social media posts, product descriptions, and even entire books. This can help businesses save time and resources while maintaining a consistent tone and style.\n",
+ "2. **Product Design**: Generative AI can aid in the design of products such as 3D models, logos, and packaging designs. It can also be used to generate new product ideas based on existing product lines.\n",
+ "3. **Marketing Campaigns**: Generative AI can help create personalized marketing campaigns by generating targeted content, social media posts, and even entire ad campaigns.\n",
+ "4. **Image and Video Generation**: Generative AI can be used to generate high-quality images and videos for businesses such as e-commerce websites, social media platforms, and advertising agencies.\n",
+ "5. **Customer Service Chatbots**: Generative AI-powered chatbots can provide personalized customer service experiences by generating responses based on the customer's query or intent.\n",
+ "6. **Financial Analysis**: Generative AI can be used to analyze financial data, generate forecasts, and even create investment strategies for businesses and investors.\n",
+ "7. **Supply Chain Optimization**: Generative AI can help optimize supply chain operations by predicting demand, identifying bottlenecks, and optimizing logistics.\n",
+ "8. **Human Resources Management**: Generative AI can aid in HR tasks such as talent acquisition, resume screening, and employee performance analysis.\n",
+ "9. **Cybersecurity Threat Detection**: Generative AI-powered systems can detect and predict cyber threats by analyzing network traffic, system logs, and other data sources.\n",
+ "10. **Data Journalism**: Generative AI can be used to generate leads for investigative journalism projects, analyze large datasets, and even create visualizations of complex data.\n",
+ "\n",
+ "Some industries that are heavily impacted by generative AI include:\n",
+ "\n",
+ "1. **Media and Entertainment**: Generative AI is being used in content creation, music production, and video editing.\n",
+ "2. **E-commerce**: Generative AI can aid in product design, image generation, and customer service chatbots.\n",
+ "3. **Finance and Banking**: Generative AI can be used for financial analysis, risk assessment, and portfolio optimization.\n",
+ "4. **Healthcare**: Generative AI is being used to analyze medical data, generate new treatments, and optimize patient outcomes.\n",
+ "5. **Manufacturing**: Generative AI can aid in product design, supply chain optimization, and predictive maintenance.\n",
+ "\n",
+ "Overall, generative AI has the potential to transform businesses across various industries by automating repetitive tasks, providing new insights, and enhancing customer experiences.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import ollama\n",
+ "\n",
+ "response = ollama.chat(model=MODEL, messages=messages)\n",
+ "print(response['message']['content'])"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a4704e10-f5fb-4c15-a935-f046c06fb13d",
+ "metadata": {},
+ "source": [
+ "## Alternative approach - using OpenAI python library to connect to Ollama"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "23057e00-b6fc-4678-93a9-6b31cb704bff",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Generative AI has numerous business applications across various industries, including:\n",
+ "\n",
+ "1. **Content Creation**: Generative AI can generate high-quality content such as text, images, and videos, reducing the need for manual labor and increasing efficiency.\n",
+ "2. **Marketing and Advertising**: Generative AI can create personalized marketing campaigns, product recommendations, and ad copy, improving customer engagement and conversion rates.\n",
+ "3. **Product Design**: Generative AI can design products, prototypes, and even entire product lines, streamlining the innovation process and reducing development costs.\n",
+ "4. **Virtual Productization**: Generative AI can generate digital twins of physical products, allowing for testing, iteration, and virtual marketing without the need for physical prototyping.\n",
+ "5. **Chatbots and Customer Service**: Generative AI-powered chatbots can provide personalized customer support, answer frequently asked questions, and handle routine tasks, freeing up human customer service agents to focus on complex issues.\n",
+ "6. **Data Analytics**: Generative AI can analyze large datasets, identify patterns, and predict trends, providing actionable insights for business decision-making.\n",
+ "7. **Predictive Maintenance**: Generative AI can predict equipment failures, schedule maintenance, and optimize resource allocation, reducing downtime and increasing overall efficiency.\n",
+ "8. **Image Recognition**: Generative AI can recognize and classify images, enabling applications such as self-driving cars, security monitoring, and medical diagnosis.\n",
+ "9. **Voice Assistants**: Generative AI can power voice assistants, providing users with personalized recommendations, scheduling appointments, and controlling smart home devices.\n",
+ "10. **Research and Development**: Generative AI can generate hypotheses, simulate experiments, and predict outcomes, accelerating the pace of innovation and discovery.\n",
+ "\n",
+ "Some specific business use cases include:\n",
+ "\n",
+ "* **Automated content writing**: Generative AI can write articles, blog posts, and social media content for news agencies, publishers, and marketing firms.\n",
+ "* **Virtual fashion designers**: Generative AI can design clothing, accessories, and even entire fashion collections, reducing the need for human designers and enabling mass customization.\n",
+ "* **Personal finance advisors**: Generative AI can provide personalized financial planning, budgeting, and investment advice to individuals and businesses.\n",
+ "* **Intelligent transportation systems**: Generative AI can optimize traffic flow, predict maintenance needs, and improve overall safety and efficiency in urban areas.\n",
+ "\n",
+ "These are just a few examples of the many business applications of Generative AI. As the technology continues to evolve, we can expect to see even more innovative solutions emerge across various industries.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# There's actually an alternative approach that some people might prefer\n",
+ "# You can use the OpenAI client python library to call Ollama:\n",
+ "\n",
+ "from openai import OpenAI\n",
+ "ollama_via_openai = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')\n",
+ "\n",
+ "response = ollama_via_openai.chat.completions.create(\n",
+ " model=MODEL,\n",
+ " messages=messages\n",
+ ")\n",
+ "\n",
+ "print(response.choices[0].message.content)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1622d9bb-5c68-4d4e-9ca4-b492c751f898",
+ "metadata": {},
+ "source": [
+ "# NOW the exercise for you\n",
+ "\n",
+ "Take the code from day1 and incorporate it here, to build a website summarizer that uses Llama 3.2 running locally instead of OpenAI; use either of the above approaches."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "402d5686-4e76-4110-b65a-b3906c35c0a4",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "class Website:\n",
+ " \n",
+ " def __init__(self, url):\n",
+ " \n",
+ " self.url = url\n",
+ " HEADERS = {\"Content-Type\": \"application/json\"}\n",
+ " response = requests.get(self.url, headers = HEADERS)\n",
+ " soup = BeautifulSoup(response.content, \"html.parser\")\n",
+ " \n",
+ " self.title = soup.title.string if soup.title else \"No Title Found!\"\n",
+ " \n",
+ " for item in soup.body([\"img\",\"script\",\"style\",\"input\"]):\n",
+ " item.decompose() \n",
+ " \n",
+ " self.text = soup.body.get_text(separator=\"\\n\", strip=True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "5f4bc0a1",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Kanit Vural | Data Scientist & ML Engineer\n",
+ "Home\n",
+ "About\n",
+ "Skills\n",
+ "Projects\n",
+ "Blog\n",
+ "Contact\n",
+ "Kanıt Vural\n",
+ "|\n",
+ "Transforming data into actionable insights and building intelligent solutions\n",
+ "Get in Touch\n",
+ "About Me\n",
+ "Data Scientist & Mine Research & Development Engineer with expertise in AI-driven solutions\n",
+ "He began his career in 2008 at Erdemir Mining Company as a Mining R&D Engineer, part of Oyak Mining Metallurgy Group in Divriği, Turkey. Early on, he worked on geophysical gravity and magnetic iron ore exploration and learned Surpac software to create 3D solid models from drill data. He enhanced his skills in Geostatistics through training at Hacettepe University.\n",
+ "With this expertise, he created block models and conducted reserve classifications, improving the company’s cost-efficiency and profits. He played a key role in discovering new fields and developing existing reserves, contributing to significant financial gains.\n",
+ "In 2020, he joined Tosyalı Iron Steel Angola, a subsidiary of Tosyalı Holding, in Jamba, Angola. He continued reserve classifications using Datamine software and discovered new iron and gold fields. He also mentored junior engineers by providing Datamine training.\n",
+ "Software has always been his passion, starting in high school and continuing throughout his career. He pursued courses in web development, mobile app development, cybersecurity, and data science, eventually discovering his true passion for data science. He took a career break to intensively train in this field, and continues to learn and work on projects daily.\n",
+ "Key Achievements\n",
+ "Discovered iron ore deposits totaling more than 300 million tons across multiple sites.\n",
+ "Applied AI-driven approaches to his work, boosting efficiency.\n",
+ "Passionately mentored junior engineers, empowering them to grow and reach their full potential.\n",
+ "With all the knowledge and experience gained over 15 years, he is ready to create added value by applying it in both the mining and IT industries.\n",
+ "Download CV\n",
+ "GitHub\n",
+ "AI/ML\n",
+ "Cloud\n",
+ "Data\n",
+ "MLOps\n",
+ "Skills & Expertise\n",
+ "Data Analysis\n",
+ "Statistical Analysis\n",
+ "Data Visualization\n",
+ "CRM Analytics\n",
+ "Machine & Deep Learning\n",
+ "Machine Learning Models\n",
+ "Computer Vision\n",
+ "Natural Language Processing\n",
+ "Cloud & Infrastructure\n",
+ "AWS Services\n",
+ "MLOps\n",
+ "Data Engineering\n",
+ "Generative AI\n",
+ "Large Language Models\n",
+ "Prompt Engineering\n",
+ "AI Applications\n",
+ "Mine Research & Development\n",
+ "Mine Exploration\n",
+ "Geostatistics\n",
+ "Solid & Block Modeling\n",
+ "Technologies I Work With\n",
+ "Python\n",
+ "NumPy\n",
+ "Pandas\n",
+ "Scikit-learn\n",
+ "TensorFlow\n",
+ "PyTorch\n",
+ "PySpark\n",
+ "Power BI\n",
+ "ChatGPT\n",
+ "Claude\n",
+ "LangChain\n",
+ "HuggingFace\n",
+ "FastAPI\n",
+ "Streamlit\n",
+ "Gradio\n",
+ "PostgreSQL\n",
+ "MLflow\n",
+ "Docker\n",
+ "Kubernetes\n",
+ "Git\n",
+ "GitHub\n",
+ "Red Hat\n",
+ "Jenkins\n",
+ "AWS\n",
+ "Terraform\n",
+ "Hadoop\n",
+ "Kafka\n",
+ "Airflow\n",
+ "JavaScript\n",
+ "Node.js\n",
+ "Datamine\n",
+ "Surpac\n",
+ "Qgis\n",
+ "Featured Projects\n",
+ "Smile-Based Face Recognition Access Control System\n",
+ "A facial recognition application using AWS infrastructure that activates with your smile and grants\n",
+ " access to registered users. Features email notifications, entry logging, and optional ChatGPT\n",
+ " integration.\n",
+ "AWS\n",
+ "Terraform\n",
+ "Python\n",
+ "Face Recognition\n",
+ "Learn More\n",
+ "Voice2Image AI Generator\n",
+ "An innovative application that transforms voice into images using AI. Record your voice to generate\n",
+ " text via\n",
+ " OpenAI's Whisper, create images with DALL·E, and enhance results using Gemini 1.5 Pro for\n",
+ " regeneration.\n",
+ "OpenAI\n",
+ "DALL·E\n",
+ "Python\n",
+ "Gemini\n",
+ "Learn More\n",
+ "Chat with YouTube Video\n",
+ "A powerful application that allows you to interact with YouTube videos by converting them into text\n",
+ " and asking\n",
+ " questions about their content. Uses OpenAI's Whisper for speech-to-text, LangChain's RAG for Q&A, and\n",
+ " Gemini\n",
+ " Pro for chat.\n",
+ "OpenAI Whisper\n",
+ "LangChain\n",
+ "Gemini Pro\n",
+ "Streamlit\n",
+ "Learn More\n",
+ "Data Analyzer with LLM Agents\n",
+ "An intelligent application that analyzes CSV files using advanced language models. Features automatic\n",
+ " descriptive statistics, data visualization, and LLM-powered Q&A about datasets. Supports multiple\n",
+ " models like\n",
+ " Gemini, Claude, and GPT.\n",
+ "LangChain\n",
+ "Streamlit\n",
+ "Data Analysis\n",
+ "LLM Agents\n",
+ "Learn More\n",
+ "Evolution of Sentiment Analysis\n",
+ "A comprehensive exploration of NLP techniques from rule-based to transformer models, analyzing IMDB\n",
+ " reviews.\n",
+ " Features machine learning, deep learning (LSTM, CNN), and BERT implementations with detailed\n",
+ " performance comparisons.\n",
+ "NLP\n",
+ "BERT\n",
+ "Deep Learning\n",
+ "TensorFlow\n",
+ "Learn More\n",
+ "Fish Species Classification with ANN\n",
+ "An image classification project using Artificial Neural Networks to identify 9 different fish\n",
+ " species. Features\n",
+ " smart cropping, PCA dimensionality reduction, and K-means clustering for image preprocessing,\n",
+ " achieving 91%\n",
+ " accuracy.\n",
+ "TensorFlow\n",
+ "Computer Vision\n",
+ "Neural Networks\n",
+ "Image Processing\n",
+ "Learn More\n",
+ "Cardiovascular Disease Prediction\n",
+ "A machine learning model for predicting cardiovascular diseases using patient attributes. Features\n",
+ " MLflow for\n",
+ " model tracking, Gradio for UI, and FastAPI backend. Analyzes various health metrics including ECG\n",
+ " results,\n",
+ " blood pressure, and cholesterol levels.\n",
+ "MLflow\n",
+ "FastAPI\n",
+ "Gradio\n",
+ "Machine Learning\n",
+ "Learn More\n",
+ "Vegetable Image Classification\n",
+ "A deep learning project that classifies 15 different types of vegetables using transfer learning with\n",
+ " EfficientNet B0. Features a Gradio interface for easy interaction, PyTorch implementation, and high\n",
+ " accuracy\n",
+ " image recognition.\n",
+ "PyTorch\n",
+ "EfficientNet\n",
+ "Gradio\n",
+ "Transfer Learning\n",
+ "Learn More\n",
+ "CRM Analytics & Customer Segmentation\n",
+ "A comprehensive CRM analysis project featuring cohort analysis, customer lifetime value prediction\n",
+ " using\n",
+ " BG-NBD and Gamma-Gamma models, RFM analysis, and purchase propensity prediction. Includes customer\n",
+ " segmentation and targeted marketing strategies.\n",
+ "Customer Analytics\n",
+ "Machine Learning\n",
+ "RFM Analysis\n",
+ "CLTV Prediction\n",
+ "Learn More\n",
+ "Amazon Multi-Model Analysis\n",
+ "A comprehensive project combining sentiment analysis (LSTM with self-attention), image classification\n",
+ " (EfficientNetB0), and recommendation systems. Features transfer learning, BERT embeddings, and\n",
+ " FAISS/ChromaDB\n",
+ " for similarity search.\n",
+ "Deep Learning\n",
+ "BERT\n",
+ "AWS\n",
+ "TensorFlow\n",
+ "Learn More\n",
+ "Latest Blog Posts\n",
+ "Tracing the Evolution of Natural Language Processing Through Sentiment Analysis\n",
+ "An exploration of NLP's journey and its applications in sentiment\n",
+ " analysis...\n",
+ "Read on Medium\n",
+ "Building a Smile-Based Access Control System Using AWS\n",
+ "Let your smile be your password - A unique approach to access\n",
+ " control\n",
+ " using AWS services and facial recognition...\n",
+ "Read on Medium\n",
+ "Get in Touch\n",
+ "Interested in collaboration? Let's connect!\n",
+ "[email protected]\n",
+ "© 2025 Kanıt Vural. All rights reserved.\n"
+ ]
+ }
+ ],
+ "source": [
+ "kanit = Website(\"https://kanitvural.com\")\n",
+ "print(kanit.title)\n",
+ "print(kanit.text)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "c5e0d4e9",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "system_prompt = \"You are an assistant that analyzes the contents of a website \\\n",
+ "and provides a short summary, ignoring text that might be navigation related. \\\n",
+ "Respond in markdown.\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "a6256788",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def user_prompt_for(website):\n",
+ " user_prompt = f\"You are looking at a website titled {website.title}\"\n",
+ " user_prompt += \"\\nThe contents of this website is as follows; \\\n",
+ "please provide a short summary of this website in markdown. \\\n",
+ "If it includes news or announcements, then summarize these too.\\n\\n\"\n",
+ " user_prompt += website.text\n",
+ " return user_prompt"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "280d319c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def messages_for(website):\n",
+ " return [\n",
+ " {\"role\": \"system\", \"content\": system_prompt},\n",
+ " {\"role\": \"user\", \"content\": user_prompt_for(website)}\n",
+ " ]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "696c6316",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "\n",
+ "MODEL = \"llama3.2\"\n",
+ "ollama_via_openai = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "id": "da1928f8",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def summarize(url):\n",
+ " website = Website(url)\n",
+ " response = ollama_via_openai.chat.completions.create(\n",
+ " model=MODEL,\n",
+ " messages=messages_for(website)\n",
+ " )\n",
+ " return response.choices[0].message.content\n",
+ "\n",
+ "def display_summary(url):\n",
+ " summary = summarize(url)\n",
+ " display(Markdown(summary))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "id": "4b87d41d",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/markdown": [
+ "### Summary of Kanit Vural's Website\n",
+ "\n",
+ "Kanit Vural is a Data Scientist & ML Engineer with expertise in AI-driven solutions. His website provides an overview of his skills, experience, and projects.\n",
+ "\n",
+ "#### Key Insights\n",
+ "\n",
+ "* **15+ years of experience**: Starting as a Mining R&D Engineer in 2008.\n",
+ "* **Strong foundation in geostatistics** through Hacettepe University training.\n",
+ "* **Wide range of technologies**: Python, NumPy, Pandas, Scikit-learn, TensorFlow, PyTorch, and more.\n",
+ "* **Variety of projects**:\n",
+ "\t+ Face recognition application\n",
+ "\t+ Voice-to-image converter using AI\n",
+ "\t+ Chatbot for YouTube videos\n",
+ "\t+ Intelligent data analysis with LLM agents\n",
+ "\t+ Comprehensive exploration of sentiment analysis and NLP techniques.\n",
+ "\n",
+ "#### Featured Projects\n",
+ "\n",
+ "1. Smile-Based Face Recognition Access Control System\n",
+ "2. Data Analyzer with LLM Agents\n",
+ "3. Evolution of Sentiment Analysis\n",
+ "4. Fish Species Classification with ANN\n",
+ "5. Cardiovascular Disease Prediction\n",
+ "6. Vegetable Image Classification\n",
+ "7. CRM Analytics & Customer Segmentation\n",
+ "8. Amazon Multi-Model Analysis"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "display_summary(\"https://kanitvural.com\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "9f072c77",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "venv",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.12.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/week1/day1.ipynb b/week1/day1.ipynb
index d1823b1..6abb44c 100644
--- a/week1/day1.ipynb
+++ b/week1/day1.ipynb
@@ -72,7 +72,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 1,
"id": "4e2a9393-7767-488e-a8bf-27c12dca35bd",
"metadata": {},
"outputs": [],
@@ -111,10 +111,18 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 2,
"id": "7b87cadb-d513-4303-baee-a37b6f938e4d",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "API key found and looks good so far!\n"
+ ]
+ }
+ ],
"source": [
"# Load environment variables in a file called .env\n",
"\n",
@@ -135,7 +143,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 3,
"id": "019974d9-f3ad-4a8a-b5f9-0a3719aea2d3",
"metadata": {},
"outputs": [],
@@ -156,15 +164,23 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 4,
"id": "a58394bf-1e45-46af-9bfd-01e24da6f49a",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Hello! Welcome to our chat! What can I help you with today?\n"
+ ]
+ }
+ ],
"source": [
"# To give you a preview -- calling OpenAI with these messages is this easy. Any problems, head over to the Troubleshooting notebook.\n",
"\n",
"message = \"Hello, GPT! This is my first ever message to you! Hi!\"\n",
- "response = openai.chat.completions.create(model=\"gpt-4o-mini\", messages=[{\"role\":\"user\", \"content\":message}])\n",
+ "response = openai.chat.completions.create(model=\"gpt-3.5-turbo\", messages=[{\"role\":\"user\", \"content\":message}])\n",
"print(response.choices[0].message.content)"
]
},
@@ -178,7 +194,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 5,
"id": "c5e793b2-6775-426a-a139-4848291d0463",
"metadata": {},
"outputs": [],
@@ -208,16 +224,223 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 8,
"id": "2ef960cf-6dc2-4cda-afb3-b38be12f4c97",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Kanit Vural | Data Scientist & ML Engineer\n",
+ "Home\n",
+ "About\n",
+ "Skills\n",
+ "Projects\n",
+ "Blog\n",
+ "Contact\n",
+ "Kanıt Vural\n",
+ "|\n",
+ "Transforming data into actionable insights and building intelligent solutions\n",
+ "Get in Touch\n",
+ "About Me\n",
+ "Data Scientist & Mine Research & Development Engineer with expertise in AI-driven solutions\n",
+ "He began his career in 2008 at Erdemir Mining Company as a Mining R&D Engineer, part of Oyak Mining Metallurgy Group in Divriği, Turkey. Early on, he worked on geophysical gravity and magnetic iron ore exploration and learned Surpac software to create 3D solid models from drill data. He enhanced his skills in Geostatistics through training at Hacettepe University.\n",
+ "With this expertise, he created block models and conducted reserve classifications, improving the company’s cost-efficiency and profits. He played a key role in discovering new fields and developing existing reserves, contributing to significant financial gains.\n",
+ "In 2020, he joined Tosyalı Iron Steel Angola, a subsidiary of Tosyalı Holding, in Jamba, Angola. He continued reserve classifications using Datamine software and discovered new iron and gold fields. He also mentored junior engineers by providing Datamine training.\n",
+ "Software has always been his passion, starting in high school and continuing throughout his career. He pursued courses in web development, mobile app development, cybersecurity, and data science, eventually discovering his true passion for data science. He took a career break to intensively train in this field, and continues to learn and work on projects daily.\n",
+ "Key Achievements\n",
+ "Discovered iron ore deposits totaling more than 300 million tons across multiple sites.\n",
+ "Applied AI-driven approaches to his work, boosting efficiency.\n",
+ "Passionately mentored junior engineers, empowering them to grow and reach their full potential.\n",
+ "With all the knowledge and experience gained over 15 years, he is ready to create added value by applying it in both the mining and IT industries.\n",
+ "Download CV\n",
+ "GitHub\n",
+ "AI/ML\n",
+ "Cloud\n",
+ "Data\n",
+ "MLOps\n",
+ "Skills & Expertise\n",
+ "Data Analysis\n",
+ "Statistical Analysis\n",
+ "Data Visualization\n",
+ "CRM Analytics\n",
+ "Machine & Deep Learning\n",
+ "Machine Learning Models\n",
+ "Computer Vision\n",
+ "Natural Language Processing\n",
+ "Cloud & Infrastructure\n",
+ "AWS Services\n",
+ "MLOps\n",
+ "Data Engineering\n",
+ "Generative AI\n",
+ "Large Language Models\n",
+ "Prompt Engineering\n",
+ "AI Applications\n",
+ "Mine Research & Development\n",
+ "Mine Exploration\n",
+ "Geostatistics\n",
+ "Solid & Block Modeling\n",
+ "Technologies I Work With\n",
+ "Python\n",
+ "NumPy\n",
+ "Pandas\n",
+ "Scikit-learn\n",
+ "TensorFlow\n",
+ "PyTorch\n",
+ "PySpark\n",
+ "Power BI\n",
+ "ChatGPT\n",
+ "Claude\n",
+ "LangChain\n",
+ "HuggingFace\n",
+ "FastAPI\n",
+ "Streamlit\n",
+ "Gradio\n",
+ "PostgreSQL\n",
+ "MLflow\n",
+ "Docker\n",
+ "Kubernetes\n",
+ "Git\n",
+ "GitHub\n",
+ "Red Hat\n",
+ "Jenkins\n",
+ "AWS\n",
+ "Terraform\n",
+ "Hadoop\n",
+ "Kafka\n",
+ "Airflow\n",
+ "JavaScript\n",
+ "Node.js\n",
+ "Datamine\n",
+ "Surpac\n",
+ "Qgis\n",
+ "Featured Projects\n",
+ "Smile-Based Face Recognition Access Control System\n",
+ "A facial recognition application using AWS infrastructure that activates with your smile and grants\n",
+ " access to registered users. Features email notifications, entry logging, and optional ChatGPT\n",
+ " integration.\n",
+ "AWS\n",
+ "Terraform\n",
+ "Python\n",
+ "Face Recognition\n",
+ "Learn More\n",
+ "Voice2Image AI Generator\n",
+ "An innovative application that transforms voice into images using AI. Record your voice to generate\n",
+ " text via\n",
+ " OpenAI's Whisper, create images with DALL·E, and enhance results using Gemini 1.5 Pro for\n",
+ " regeneration.\n",
+ "OpenAI\n",
+ "DALL·E\n",
+ "Python\n",
+ "Gemini\n",
+ "Learn More\n",
+ "Chat with YouTube Video\n",
+ "A powerful application that allows you to interact with YouTube videos by converting them into text\n",
+ " and asking\n",
+ " questions about their content. Uses OpenAI's Whisper for speech-to-text, LangChain's RAG for Q&A, and\n",
+ " Gemini\n",
+ " Pro for chat.\n",
+ "OpenAI Whisper\n",
+ "LangChain\n",
+ "Gemini Pro\n",
+ "Streamlit\n",
+ "Learn More\n",
+ "Data Analyzer with LLM Agents\n",
+ "An intelligent application that analyzes CSV files using advanced language models. Features automatic\n",
+ " descriptive statistics, data visualization, and LLM-powered Q&A about datasets. Supports multiple\n",
+ " models like\n",
+ " Gemini, Claude, and GPT.\n",
+ "LangChain\n",
+ "Streamlit\n",
+ "Data Analysis\n",
+ "LLM Agents\n",
+ "Learn More\n",
+ "Evolution of Sentiment Analysis\n",
+ "A comprehensive exploration of NLP techniques from rule-based to transformer models, analyzing IMDB\n",
+ " reviews.\n",
+ " Features machine learning, deep learning (LSTM, CNN), and BERT implementations with detailed\n",
+ " performance comparisons.\n",
+ "NLP\n",
+ "BERT\n",
+ "Deep Learning\n",
+ "TensorFlow\n",
+ "Learn More\n",
+ "Fish Species Classification with ANN\n",
+ "An image classification project using Artificial Neural Networks to identify 9 different fish\n",
+ " species. Features\n",
+ " smart cropping, PCA dimensionality reduction, and K-means clustering for image preprocessing,\n",
+ " achieving 91%\n",
+ " accuracy.\n",
+ "TensorFlow\n",
+ "Computer Vision\n",
+ "Neural Networks\n",
+ "Image Processing\n",
+ "Learn More\n",
+ "Cardiovascular Disease Prediction\n",
+ "A machine learning model for predicting cardiovascular diseases using patient attributes. Features\n",
+ " MLflow for\n",
+ " model tracking, Gradio for UI, and FastAPI backend. Analyzes various health metrics including ECG\n",
+ " results,\n",
+ " blood pressure, and cholesterol levels.\n",
+ "MLflow\n",
+ "FastAPI\n",
+ "Gradio\n",
+ "Machine Learning\n",
+ "Learn More\n",
+ "Vegetable Image Classification\n",
+ "A deep learning project that classifies 15 different types of vegetables using transfer learning with\n",
+ " EfficientNet B0. Features a Gradio interface for easy interaction, PyTorch implementation, and high\n",
+ " accuracy\n",
+ " image recognition.\n",
+ "PyTorch\n",
+ "EfficientNet\n",
+ "Gradio\n",
+ "Transfer Learning\n",
+ "Learn More\n",
+ "CRM Analytics & Customer Segmentation\n",
+ "A comprehensive CRM analysis project featuring cohort analysis, customer lifetime value prediction\n",
+ " using\n",
+ " BG-NBD and Gamma-Gamma models, RFM analysis, and purchase propensity prediction. Includes customer\n",
+ " segmentation and targeted marketing strategies.\n",
+ "Customer Analytics\n",
+ "Machine Learning\n",
+ "RFM Analysis\n",
+ "CLTV Prediction\n",
+ "Learn More\n",
+ "Amazon Multi-Model Analysis\n",
+ "A comprehensive project combining sentiment analysis (LSTM with self-attention), image classification\n",
+ " (EfficientNetB0), and recommendation systems. Features transfer learning, BERT embeddings, and\n",
+ " FAISS/ChromaDB\n",
+ " for similarity search.\n",
+ "Deep Learning\n",
+ "BERT\n",
+ "AWS\n",
+ "TensorFlow\n",
+ "Learn More\n",
+ "Latest Blog Posts\n",
+ "Tracing the Evolution of Natural Language Processing Through Sentiment Analysis\n",
+ "An exploration of NLP's journey and its applications in sentiment\n",
+ " analysis...\n",
+ "Read on Medium\n",
+ "Building a Smile-Based Access Control System Using AWS\n",
+ "Let your smile be your password - A unique approach to access\n",
+ " control\n",
+ " using AWS services and facial recognition...\n",
+ "Read on Medium\n",
+ "Get in Touch\n",
+ "Interested in collaboration? Let's connect!\n",
+ "[email protected]\n",
+ "© 2025 Kanıt Vural. All rights reserved.\n"
+ ]
+ }
+ ],
"source": [
"# Let's try one out. Change the website and add print statements to follow along.\n",
"\n",
- "ed = Website(\"https://edwarddonner.com\")\n",
- "print(ed.title)\n",
- "print(ed.text)"
+ "kanit = Website(\"https://kanitvural.com\")\n",
+ "print(kanit.title)\n",
+ "print(kanit.text)"
]
},
{
@@ -240,7 +463,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 16,
"id": "abdb8417-c5dc-44bc-9bee-2e059d162699",
"metadata": {},
"outputs": [],
@@ -254,7 +477,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 10,
"id": "f0275b1b-7cfe-4f9d-abfa-7650d378da0c",
"metadata": {},
"outputs": [],
@@ -272,12 +495,221 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "id": "26448ec4-5c00-4204-baec-7df91d11ff2e",
+ "execution_count": 11,
+ "id": "47a22222",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "You are looking at a website titled Kanit Vural | Data Scientist & ML Engineer\n",
+ "The contents of this website is as follows; please provide a short summary of this website in markdown. If it includes news or announcements, then summarize these too.\n",
+ "\n",
+ "Home\n",
+ "About\n",
+ "Skills\n",
+ "Projects\n",
+ "Blog\n",
+ "Contact\n",
+ "Kanıt Vural\n",
+ "|\n",
+ "Transforming data into actionable insights and building intelligent solutions\n",
+ "Get in Touch\n",
+ "About Me\n",
+ "Data Scientist & Mine Research & Development Engineer with expertise in AI-driven solutions\n",
+ "He began his career in 2008 at Erdemir Mining Company as a Mining R&D Engineer, part of Oyak Mining Metallurgy Group in Divriği, Turkey. Early on, he worked on geophysical gravity and magnetic iron ore exploration and learned Surpac software to create 3D solid models from drill data. He enhanced his skills in Geostatistics through training at Hacettepe University.\n",
+ "With this expertise, he created block models and conducted reserve classifications, improving the company’s cost-efficiency and profits. He played a key role in discovering new fields and developing existing reserves, contributing to significant financial gains.\n",
+ "In 2020, he joined Tosyalı Iron Steel Angola, a subsidiary of Tosyalı Holding, in Jamba, Angola. He continued reserve classifications using Datamine software and discovered new iron and gold fields. He also mentored junior engineers by providing Datamine training.\n",
+ "Software has always been his passion, starting in high school and continuing throughout his career. He pursued courses in web development, mobile app development, cybersecurity, and data science, eventually discovering his true passion for data science. He took a career break to intensively train in this field, and continues to learn and work on projects daily.\n",
+ "Key Achievements\n",
+ "Discovered iron ore deposits totaling more than 300 million tons across multiple sites.\n",
+ "Applied AI-driven approaches to his work, boosting efficiency.\n",
+ "Passionately mentored junior engineers, empowering them to grow and reach their full potential.\n",
+ "With all the knowledge and experience gained over 15 years, he is ready to create added value by applying it in both the mining and IT industries.\n",
+ "Download CV\n",
+ "GitHub\n",
+ "AI/ML\n",
+ "Cloud\n",
+ "Data\n",
+ "MLOps\n",
+ "Skills & Expertise\n",
+ "Data Analysis\n",
+ "Statistical Analysis\n",
+ "Data Visualization\n",
+ "CRM Analytics\n",
+ "Machine & Deep Learning\n",
+ "Machine Learning Models\n",
+ "Computer Vision\n",
+ "Natural Language Processing\n",
+ "Cloud & Infrastructure\n",
+ "AWS Services\n",
+ "MLOps\n",
+ "Data Engineering\n",
+ "Generative AI\n",
+ "Large Language Models\n",
+ "Prompt Engineering\n",
+ "AI Applications\n",
+ "Mine Research & Development\n",
+ "Mine Exploration\n",
+ "Geostatistics\n",
+ "Solid & Block Modeling\n",
+ "Technologies I Work With\n",
+ "Python\n",
+ "NumPy\n",
+ "Pandas\n",
+ "Scikit-learn\n",
+ "TensorFlow\n",
+ "PyTorch\n",
+ "PySpark\n",
+ "Power BI\n",
+ "ChatGPT\n",
+ "Claude\n",
+ "LangChain\n",
+ "HuggingFace\n",
+ "FastAPI\n",
+ "Streamlit\n",
+ "Gradio\n",
+ "PostgreSQL\n",
+ "MLflow\n",
+ "Docker\n",
+ "Kubernetes\n",
+ "Git\n",
+ "GitHub\n",
+ "Red Hat\n",
+ "Jenkins\n",
+ "AWS\n",
+ "Terraform\n",
+ "Hadoop\n",
+ "Kafka\n",
+ "Airflow\n",
+ "JavaScript\n",
+ "Node.js\n",
+ "Datamine\n",
+ "Surpac\n",
+ "Qgis\n",
+ "Featured Projects\n",
+ "Smile-Based Face Recognition Access Control System\n",
+ "A facial recognition application using AWS infrastructure that activates with your smile and grants\n",
+ " access to registered users. Features email notifications, entry logging, and optional ChatGPT\n",
+ " integration.\n",
+ "AWS\n",
+ "Terraform\n",
+ "Python\n",
+ "Face Recognition\n",
+ "Learn More\n",
+ "Voice2Image AI Generator\n",
+ "An innovative application that transforms voice into images using AI. Record your voice to generate\n",
+ " text via\n",
+ " OpenAI's Whisper, create images with DALL·E, and enhance results using Gemini 1.5 Pro for\n",
+ " regeneration.\n",
+ "OpenAI\n",
+ "DALL·E\n",
+ "Python\n",
+ "Gemini\n",
+ "Learn More\n",
+ "Chat with YouTube Video\n",
+ "A powerful application that allows you to interact with YouTube videos by converting them into text\n",
+ " and asking\n",
+ " questions about their content. Uses OpenAI's Whisper for speech-to-text, LangChain's RAG for Q&A, and\n",
+ " Gemini\n",
+ " Pro for chat.\n",
+ "OpenAI Whisper\n",
+ "LangChain\n",
+ "Gemini Pro\n",
+ "Streamlit\n",
+ "Learn More\n",
+ "Data Analyzer with LLM Agents\n",
+ "An intelligent application that analyzes CSV files using advanced language models. Features automatic\n",
+ " descriptive statistics, data visualization, and LLM-powered Q&A about datasets. Supports multiple\n",
+ " models like\n",
+ " Gemini, Claude, and GPT.\n",
+ "LangChain\n",
+ "Streamlit\n",
+ "Data Analysis\n",
+ "LLM Agents\n",
+ "Learn More\n",
+ "Evolution of Sentiment Analysis\n",
+ "A comprehensive exploration of NLP techniques from rule-based to transformer models, analyzing IMDB\n",
+ " reviews.\n",
+ " Features machine learning, deep learning (LSTM, CNN), and BERT implementations with detailed\n",
+ " performance comparisons.\n",
+ "NLP\n",
+ "BERT\n",
+ "Deep Learning\n",
+ "TensorFlow\n",
+ "Learn More\n",
+ "Fish Species Classification with ANN\n",
+ "An image classification project using Artificial Neural Networks to identify 9 different fish\n",
+ " species. Features\n",
+ " smart cropping, PCA dimensionality reduction, and K-means clustering for image preprocessing,\n",
+ " achieving 91%\n",
+ " accuracy.\n",
+ "TensorFlow\n",
+ "Computer Vision\n",
+ "Neural Networks\n",
+ "Image Processing\n",
+ "Learn More\n",
+ "Cardiovascular Disease Prediction\n",
+ "A machine learning model for predicting cardiovascular diseases using patient attributes. Features\n",
+ " MLflow for\n",
+ " model tracking, Gradio for UI, and FastAPI backend. Analyzes various health metrics including ECG\n",
+ " results,\n",
+ " blood pressure, and cholesterol levels.\n",
+ "MLflow\n",
+ "FastAPI\n",
+ "Gradio\n",
+ "Machine Learning\n",
+ "Learn More\n",
+ "Vegetable Image Classification\n",
+ "A deep learning project that classifies 15 different types of vegetables using transfer learning with\n",
+ " EfficientNet B0. Features a Gradio interface for easy interaction, PyTorch implementation, and high\n",
+ " accuracy\n",
+ " image recognition.\n",
+ "PyTorch\n",
+ "EfficientNet\n",
+ "Gradio\n",
+ "Transfer Learning\n",
+ "Learn More\n",
+ "CRM Analytics & Customer Segmentation\n",
+ "A comprehensive CRM analysis project featuring cohort analysis, customer lifetime value prediction\n",
+ " using\n",
+ " BG-NBD and Gamma-Gamma models, RFM analysis, and purchase propensity prediction. Includes customer\n",
+ " segmentation and targeted marketing strategies.\n",
+ "Customer Analytics\n",
+ "Machine Learning\n",
+ "RFM Analysis\n",
+ "CLTV Prediction\n",
+ "Learn More\n",
+ "Amazon Multi-Model Analysis\n",
+ "A comprehensive project combining sentiment analysis (LSTM with self-attention), image classification\n",
+ " (EfficientNetB0), and recommendation systems. Features transfer learning, BERT embeddings, and\n",
+ " FAISS/ChromaDB\n",
+ " for similarity search.\n",
+ "Deep Learning\n",
+ "BERT\n",
+ "AWS\n",
+ "TensorFlow\n",
+ "Learn More\n",
+ "Latest Blog Posts\n",
+ "Tracing the Evolution of Natural Language Processing Through Sentiment Analysis\n",
+ "An exploration of NLP's journey and its applications in sentiment\n",
+ " analysis...\n",
+ "Read on Medium\n",
+ "Building a Smile-Based Access Control System Using AWS\n",
+ "Let your smile be your password - A unique approach to access\n",
+ " control\n",
+ " using AWS services and facial recognition...\n",
+ "Read on Medium\n",
+ "Get in Touch\n",
+ "Interested in collaboration? Let's connect!\n",
+ "[email protected]\n",
+ "© 2025 Kanıt Vural. All rights reserved.\n"
+ ]
+ }
+ ],
"source": [
- "print(user_prompt_for(ed))"
+ "print(user_prompt_for(kanit))"
]
},
{
@@ -301,7 +733,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 12,
"id": "f25dcd35-0cd0-4235-9f64-ac37ed9eaaa5",
"metadata": {},
"outputs": [],
@@ -314,14 +746,22 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 13,
"id": "21ed95c5-7001-47de-a36d-1d6673b403ce",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Hmm, let me put on my thinking cap for this one... *drumroll*... 2 + 2 equals 4! So exciting, right?\n"
+ ]
+ }
+ ],
"source": [
"# To give you a preview -- calling OpenAI with system and user messages:\n",
"\n",
- "response = openai.chat.completions.create(model=\"gpt-4o-mini\", messages=messages)\n",
+ "response = openai.chat.completions.create(model=\"gpt-3.5-turbo\", messages=messages)\n",
"print(response.choices[0].message.content)"
]
},
@@ -335,7 +775,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 14,
"id": "0134dfa4-8299-48b5-b444-f2a8c3403c88",
"metadata": {},
"outputs": [],
@@ -351,14 +791,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
- "id": "36478464-39ee-485c-9f3f-6a4e458dbc9c",
+ "execution_count": 17,
+ "id": "26bf8bb9",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[{'role': 'system',\n",
+ " 'content': 'You are an assistant that analyzes the contents of a website and provides a short summary, ignoring text that might be navigation related. Respond in markdown.'},\n",
+ " {'role': 'user',\n",
+ " 'content': \"You are looking at a website titled Kanit Vural | Data Scientist & ML Engineer\\nThe contents of this website is as follows; please provide a short summary of this website in markdown. If it includes news or announcements, then summarize these too.\\n\\nHome\\nAbout\\nSkills\\nProjects\\nBlog\\nContact\\nKanıt Vural\\n|\\nTransforming data into actionable insights and building intelligent solutions\\nGet in Touch\\nAbout Me\\nData Scientist & Mine Research & Development Engineer with expertise in AI-driven solutions\\nHe began his career in 2008 at Erdemir Mining Company as a Mining R&D Engineer, part of Oyak Mining Metallurgy Group in Divriği, Turkey. Early on, he worked on geophysical gravity and magnetic iron ore exploration and learned Surpac software to create 3D solid models from drill data. He enhanced his skills in Geostatistics through training at Hacettepe University.\\nWith this expertise, he created block models and conducted reserve classifications, improving the company’s cost-efficiency and profits. He played a key role in discovering new fields and developing existing reserves, contributing to significant financial gains.\\nIn 2020, he joined Tosyalı Iron Steel Angola, a subsidiary of Tosyalı Holding, in Jamba, Angola. He continued reserve classifications using Datamine software and discovered new iron and gold fields. He also mentored junior engineers by providing Datamine training.\\nSoftware has always been his passion, starting in high school and continuing throughout his career. He pursued courses in web development, mobile app development, cybersecurity, and data science, eventually discovering his true passion for data science. He took a career break to intensively train in this field, and continues to learn and work on projects daily.\\nKey Achievements\\nDiscovered iron ore deposits totaling more than 300 million tons across multiple sites.\\nApplied AI-driven approaches to his work, boosting efficiency.\\nPassionately mentored junior engineers, empowering them to grow and reach their full potential.\\nWith all the knowledge and experience gained over 15 years, he is ready to create added value by applying it in both the mining and IT industries.\\nDownload CV\\nGitHub\\nAI/ML\\nCloud\\nData\\nMLOps\\nSkills & Expertise\\nData Analysis\\nStatistical Analysis\\nData Visualization\\nCRM Analytics\\nMachine & Deep Learning\\nMachine Learning Models\\nComputer Vision\\nNatural Language Processing\\nCloud & Infrastructure\\nAWS Services\\nMLOps\\nData Engineering\\nGenerative AI\\nLarge Language Models\\nPrompt Engineering\\nAI Applications\\nMine Research & Development\\nMine Exploration\\nGeostatistics\\nSolid & Block Modeling\\nTechnologies I Work With\\nPython\\nNumPy\\nPandas\\nScikit-learn\\nTensorFlow\\nPyTorch\\nPySpark\\nPower BI\\nChatGPT\\nClaude\\nLangChain\\nHuggingFace\\nFastAPI\\nStreamlit\\nGradio\\nPostgreSQL\\nMLflow\\nDocker\\nKubernetes\\nGit\\nGitHub\\nRed Hat\\nJenkins\\nAWS\\nTerraform\\nHadoop\\nKafka\\nAirflow\\nJavaScript\\nNode.js\\nDatamine\\nSurpac\\nQgis\\nFeatured Projects\\nSmile-Based Face Recognition Access Control System\\nA facial recognition application using AWS infrastructure that activates with your smile and grants\\n access to registered users. Features email notifications, entry logging, and optional ChatGPT\\n integration.\\nAWS\\nTerraform\\nPython\\nFace Recognition\\nLearn More\\nVoice2Image AI Generator\\nAn innovative application that transforms voice into images using AI. Record your voice to generate\\n text via\\n OpenAI's Whisper, create images with DALL·E, and enhance results using Gemini 1.5 Pro for\\n regeneration.\\nOpenAI\\nDALL·E\\nPython\\nGemini\\nLearn More\\nChat with YouTube Video\\nA powerful application that allows you to interact with YouTube videos by converting them into text\\n and asking\\n questions about their content. Uses OpenAI's Whisper for speech-to-text, LangChain's RAG for Q&A, and\\n Gemini\\n Pro for chat.\\nOpenAI Whisper\\nLangChain\\nGemini Pro\\nStreamlit\\nLearn More\\nData Analyzer with LLM Agents\\nAn intelligent application that analyzes CSV files using advanced language models. Features automatic\\n descriptive statistics, data visualization, and LLM-powered Q&A about datasets. Supports multiple\\n models like\\n Gemini, Claude, and GPT.\\nLangChain\\nStreamlit\\nData Analysis\\nLLM Agents\\nLearn More\\nEvolution of Sentiment Analysis\\nA comprehensive exploration of NLP techniques from rule-based to transformer models, analyzing IMDB\\n reviews.\\n Features machine learning, deep learning (LSTM, CNN), and BERT implementations with detailed\\n performance comparisons.\\nNLP\\nBERT\\nDeep Learning\\nTensorFlow\\nLearn More\\nFish Species Classification with ANN\\nAn image classification project using Artificial Neural Networks to identify 9 different fish\\n species. Features\\n smart cropping, PCA dimensionality reduction, and K-means clustering for image preprocessing,\\n achieving 91%\\n accuracy.\\nTensorFlow\\nComputer Vision\\nNeural Networks\\nImage Processing\\nLearn More\\nCardiovascular Disease Prediction\\nA machine learning model for predicting cardiovascular diseases using patient attributes. Features\\n MLflow for\\n model tracking, Gradio for UI, and FastAPI backend. Analyzes various health metrics including ECG\\n results,\\n blood pressure, and cholesterol levels.\\nMLflow\\nFastAPI\\nGradio\\nMachine Learning\\nLearn More\\nVegetable Image Classification\\nA deep learning project that classifies 15 different types of vegetables using transfer learning with\\n EfficientNet B0. Features a Gradio interface for easy interaction, PyTorch implementation, and high\\n accuracy\\n image recognition.\\nPyTorch\\nEfficientNet\\nGradio\\nTransfer Learning\\nLearn More\\nCRM Analytics & Customer Segmentation\\nA comprehensive CRM analysis project featuring cohort analysis, customer lifetime value prediction\\n using\\n BG-NBD and Gamma-Gamma models, RFM analysis, and purchase propensity prediction. Includes customer\\n segmentation and targeted marketing strategies.\\nCustomer Analytics\\nMachine Learning\\nRFM Analysis\\nCLTV Prediction\\nLearn More\\nAmazon Multi-Model Analysis\\nA comprehensive project combining sentiment analysis (LSTM with self-attention), image classification\\n (EfficientNetB0), and recommendation systems. Features transfer learning, BERT embeddings, and\\n FAISS/ChromaDB\\n for similarity search.\\nDeep Learning\\nBERT\\nAWS\\nTensorFlow\\nLearn More\\nLatest Blog Posts\\nTracing the Evolution of Natural Language Processing Through Sentiment Analysis\\nAn exploration of NLP's journey and its applications in sentiment\\n analysis...\\nRead on Medium\\nBuilding a Smile-Based Access Control System Using AWS\\nLet your smile be your password - A unique approach to access\\n control\\n using AWS services and facial recognition...\\nRead on Medium\\nGet in Touch\\nInterested in collaboration? Let's connect!\\n[email\\xa0protected]\\n© 2025 Kanıt Vural. All rights reserved.\"}]"
+ ]
+ },
+ "execution_count": 17,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
- "# Try this out, and then try for a few more websites\n",
- "\n",
- "messages_for(ed)"
+ "messages_for(kanit)"
]
},
{
@@ -371,7 +823,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 18,
"id": "905b9919-aba7-45b5-ae65-81b3d1d78e34",
"metadata": {},
"outputs": [],
@@ -389,17 +841,28 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 19,
"id": "05e38d41-dfa4-4b20-9c96-c46ea75d9fb5",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "\"# Summary of Kanit Vural's Website\\n\\nKanit Vural is a Data Scientist and Machine Learning Engineer with over 15 years of experience, particularly in the mining industry. He began his career in 2008 at Erdemir Mining Company, focusing on geophysical exploration and geostatistics, ultimately leading to significant financial improvements through new field discoveries. Later, he joined Tosyalı Iron Steel Angola, continuing similar work and mentoring junior engineers.\\n\\n## Key Achievements:\\n- Discovered over 300 million tons of iron ore deposits.\\n- Applied AI-driven solutions to enhance operational efficiency.\\n- Provided mentorship and training in mining technologies.\\n\\n## Skills and Expertise:\\n- **Data Science**: Data analysis, machine learning, computer vision, and NLP.\\n- **Cloud Technologies**: AWS services, MLOps, and data engineering.\\n- **Software Development**: Proficient in Python and various frameworks and libraries for data science and machine learning.\\n\\n## Featured Projects:\\n1. **Smile-Based Face Recognition Access Control System**: Uses AWS to grant access based on user smiles.\\n2. **Voice2Image AI Generator**: Converts voice recordings into images using AI technologies.\\n3. **Data Analyzer with LLM Agents**: Analyzes CSV files using language models.\\n4. **Evolution of Sentiment Analysis**: Explores NLP techniques for analyzing reviews.\\n5. **Cardiovascular Disease Prediction**: Machine learning model to predict health outcomes based on patient data.\\n\\n## Latest Blog Posts:\\n- **Tracing the Evolution of Natural Language Processing Through Sentiment Analysis**: Discusses the development of NLP and its uses.\\n- **Building a Smile-Based Access Control System Using AWS**: Outlines the innovative approach to security using facial recognition.\\n\\nKanit Vural aims to leverage his knowledge across both the mining and IT sectors to create impactful solutions.\""
+ ]
+ },
+ "execution_count": 19,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
- "summarize(\"https://edwarddonner.com\")"
+ "summarize(\"https://kanitvural.com\")"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 20,
"id": "3d926d59-450e-4609-92ba-2d6f244f1342",
"metadata": {},
"outputs": [],
@@ -413,12 +876,52 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 21,
"id": "3018853a-445f-41ff-9560-d925d1774b2f",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/markdown": [
+ "## Summary of Kanit Vural's Website\n",
+ "\n",
+ "**Kanit Vural** is a Data Scientist and Machine Learning Engineer with over 15 years of experience, primarily in the mining and IT industries. His career began at Erdemir Mining Company, where he specialized in geophysical exploration and reserve classifications, contributing to substantial financial improvements. Vural has worked with various mining companies, including Tosyalı Iron Steel Angola, and has been integral in discovering significant mineral deposits.\n",
+ "\n",
+ "### Skills and Expertise\n",
+ "Vural possesses a diverse skill set that includes:\n",
+ "- **Data Science**: Data analysis, statistical analysis, machine learning, natural language processing (NLP), and machine learning model development.\n",
+ "- **Cloud & Infrastructure**: Proficient in AWS services and MLOps.\n",
+ "- **Technologies**: Experienced in programming languages and frameworks such as Python, TensorFlow, PyTorch, and various data engineering tools.\n",
+ "\n",
+ "### Featured Projects\n",
+ "1. **Smile-Based Face Recognition Access Control System**: An innovative access control application that uses facial recognition based on smiles.\n",
+ "2. **Voice2Image AI Generator**: Transforms voice input into images using a combination of OpenAI technologies.\n",
+ "3. **Chat with YouTube Video**: Converts YouTube videos into an interactive question-and-answer format.\n",
+ "4. **Data Analyzer with LLM Agents**: An application for analyzing CSV files using advanced language models.\n",
+ "5. **Evolution of Sentiment Analysis**: An exploration of NLP techniques for analyzing movie reviews.\n",
+ "6. **Fish Species Classification**: Uses artificial neural networks for classifying fish species based on images.\n",
+ "7. **Cardiovascular Disease Prediction**: A machine learning model to predict heart diseases using patient data.\n",
+ "8. **Vegetable Image Classification**: Classifies vegetable images using deep learning techniques.\n",
+ "9. **CRM Analytics & Customer Segmentation**: Focuses on customer behavior and targeted marketing strategies.\n",
+ "10. **Amazon Multi-Model Analysis**: Integrates sentiment analysis, image classification, and recommendation systems.\n",
+ "\n",
+ "### Blog\n",
+ "The latest blog posts tackle topics such as:\n",
+ "- The evolution of natural language processing through sentiment analysis.\n",
+ "- Building a smile-based access control system utilizing AWS services.\n",
+ "\n",
+ "For collaboration opportunities or more information, Vural encourages users to reach out through contact options provided on the site."
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
- "display_summary(\"https://edwarddonner.com\")"
+ "display_summary(\"https://kanitvural.com\")"
]
},
{
@@ -439,20 +942,68 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 22,
"id": "45d83403-a24c-44b5-84ac-961449b4008f",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/markdown": [
+ "# Summary of CNN Website\n",
+ "\n",
+ "The CNN website offers a comprehensive source for breaking news and diverse topics spanning across various categories including US, World, Politics, Business, Health, Entertainment, and Sports. It features live updates, videos, and a wide range of articles addressing current events, analyses, and in-depth reports on significant global issues. \n",
+ "\n",
+ "## Key Highlights\n",
+ "\n",
+ "- **Current Events**: Live updates on pressing stories such as wildfires in LA, the Israel-Hamas War, and the Ukraine-Russia War.\n",
+ "- **Politics**: Ongoing coverage of Trump's legal challenges, Biden's final military aid package for Ukraine, and notable political events.\n",
+ "- **Health & Science**: Insights into health studies and environmental concerns, including climate-related articles and global health issues.\n",
+ "- **Entertainment & Lifestyle**: Articles on celebrity news, fashion trends, and travel destinations.\n",
+ "\n",
+ "Additionally, the site encourages user feedback to enhance the online experience and offers contact options for further inquiries or technical issues. Overall, CNN serves as a pivotal resource for up-to-date news and analysis."
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"display_summary(\"https://cnn.com\")"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 23,
"id": "75e9fd40-b354-4341-991e-863ef2e59db7",
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/markdown": [
+ "# Summary of Anthropic Website\n",
+ "\n",
+ "Anthropic is an AI safety and research company based in San Francisco, focused on developing reliable and beneficial AI systems. Their flagship product is Claude, with the latest version being Claude 3.5 Sonnet, which is now available for use. The company emphasizes the importance of AI safety and has an interdisciplinary team background in machine learning, physics, policy, and product development.\n",
+ "\n",
+ "## Recent Announcements\n",
+ "- **October 22, 2024:** Introduction of computer use, new models Claude 3.5 Sonnet and Claude 3.5 Haiku.\n",
+ "- **September 4, 2024:** Updates related to Claude for Enterprise.\n",
+ "- **March 8, 2023:** Shared core views on AI safety, focusing on the timing and methodology of AI implementation and its impacts.\n",
+ "\n",
+ "Users can leverage the capabilities of Claude through an API to create custom AI-powered applications. The site also highlights ongoing research efforts in AI alignment and safety practices. \n",
+ "\n",
+ "For potential employees, Anthropic lists open roles indicating a commitment to expanding their team."
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"display_summary(\"https://anthropic.com\")"
]
@@ -545,7 +1096,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3 (ipykernel)",
+ "display_name": "venv",
"language": "python",
"name": "python3"
},
@@ -559,7 +1110,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.11"
+ "version": "3.12.6"
}
},
"nbformat": 4,
diff --git a/week1/day2 EXERCISE.ipynb b/week1/day2 EXERCISE.ipynb
deleted file mode 100644
index fb08ca8..0000000
--- a/week1/day2 EXERCISE.ipynb
+++ /dev/null
@@ -1,246 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "d15d8294-3328-4e07-ad16-8a03e9bbfdb9",
- "metadata": {},
- "source": [
- "# Welcome to your first assignment!\n",
- "\n",
- "Instructions are below. Please give this a try, and look in the solutions folder if you get stuck (or feel free to ask me!)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "ada885d9-4d42-4d9b-97f0-74fbbbfe93a9",
- "metadata": {},
- "source": [
- "\n",
- " \n",
- " \n",
- " \n",
- " | \n",
- " \n",
- " Just before we get to the assignment --\n",
- " I thought I'd take a second to point you at this page of useful resources for the course. This includes links to all the slides. \n",
- " https://edwarddonner.com/2024/11/13/llm-engineering-resources/ \n",
- " Please keep this bookmarked, and I'll continue to add more useful links there over time.\n",
- " \n",
- " | \n",
- "
\n",
- "
"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "6e9fa1fc-eac5-4d1d-9be4-541b3f2b3458",
- "metadata": {},
- "source": [
- "# HOMEWORK EXERCISE ASSIGNMENT\n",
- "\n",
- "Upgrade the day 1 project to summarize a webpage to use an Open Source model running locally via Ollama rather than OpenAI\n",
- "\n",
- "You'll be able to use this technique for all subsequent projects if you'd prefer not to use paid APIs.\n",
- "\n",
- "**Benefits:**\n",
- "1. No API charges - open-source\n",
- "2. Data doesn't leave your box\n",
- "\n",
- "**Disadvantages:**\n",
- "1. Significantly less power than Frontier Model\n",
- "\n",
- "## Recap on installation of Ollama\n",
- "\n",
- "Simply visit [ollama.com](https://ollama.com) and install!\n",
- "\n",
- "Once complete, the ollama server should already be running locally. \n",
- "If you visit: \n",
- "[http://localhost:11434/](http://localhost:11434/)\n",
- "\n",
- "You should see the message `Ollama is running`. \n",
- "\n",
- "If not, bring up a new Terminal (Mac) or Powershell (Windows) and enter `ollama serve` \n",
- "And in another Terminal (Mac) or Powershell (Windows), enter `ollama pull llama3.2` \n",
- "Then try [http://localhost:11434/](http://localhost:11434/) again.\n",
- "\n",
- "If Ollama is slow on your machine, try using `llama3.2:1b` as an alternative. Run `ollama pull llama3.2:1b` from a Terminal or Powershell, and change the code below from `MODEL = \"llama3.2\"` to `MODEL = \"llama3.2:1b\"`"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "4e2a9393-7767-488e-a8bf-27c12dca35bd",
- "metadata": {},
- "outputs": [],
- "source": [
- "# imports\n",
- "\n",
- "import requests\n",
- "from bs4 import BeautifulSoup\n",
- "from IPython.display import Markdown, display"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "29ddd15d-a3c5-4f4e-a678-873f56162724",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Constants\n",
- "\n",
- "OLLAMA_API = \"http://localhost:11434/api/chat\"\n",
- "HEADERS = {\"Content-Type\": \"application/json\"}\n",
- "MODEL = \"llama3.2\""
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "dac0a679-599c-441f-9bf2-ddc73d35b940",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Create a messages list using the same format that we used for OpenAI\n",
- "\n",
- "messages = [\n",
- " {\"role\": \"user\", \"content\": \"Describe some of the business applications of Generative AI\"}\n",
- "]"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "7bb9c624-14f0-4945-a719-8ddb64f66f47",
- "metadata": {},
- "outputs": [],
- "source": [
- "payload = {\n",
- " \"model\": MODEL,\n",
- " \"messages\": messages,\n",
- " \"stream\": False\n",
- " }"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "479ff514-e8bd-4985-a572-2ea28bb4fa40",
- "metadata": {},
- "outputs": [],
- "source": [
- "# Let's just make sure the model is loaded\n",
- "\n",
- "!ollama pull llama3.2"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "42b9f644-522d-4e05-a691-56e7658c0ea9",
- "metadata": {},
- "outputs": [],
- "source": [
- "# If this doesn't work for any reason, try the 2 versions in the following cells\n",
- "# And double check the instructions in the 'Recap on installation of Ollama' at the top of this lab\n",
- "# And if none of that works - contact me!\n",
- "\n",
- "response = requests.post(OLLAMA_API, json=payload, headers=HEADERS)\n",
- "print(response.json()['message']['content'])"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "6a021f13-d6a1-4b96-8e18-4eae49d876fe",
- "metadata": {},
- "source": [
- "# Introducing the ollama package\n",
- "\n",
- "And now we'll do the same thing, but using the elegant ollama python package instead of a direct HTTP call.\n",
- "\n",
- "Under the hood, it's making the same call as above to the ollama server running at localhost:11434"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "7745b9c4-57dc-4867-9180-61fa5db55eb8",
- "metadata": {},
- "outputs": [],
- "source": [
- "import ollama\n",
- "\n",
- "response = ollama.chat(model=MODEL, messages=messages)\n",
- "print(response['message']['content'])"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "a4704e10-f5fb-4c15-a935-f046c06fb13d",
- "metadata": {},
- "source": [
- "## Alternative approach - using OpenAI python library to connect to Ollama"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "23057e00-b6fc-4678-93a9-6b31cb704bff",
- "metadata": {},
- "outputs": [],
- "source": [
- "# There's actually an alternative approach that some people might prefer\n",
- "# You can use the OpenAI client python library to call Ollama:\n",
- "\n",
- "from openai import OpenAI\n",
- "ollama_via_openai = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')\n",
- "\n",
- "response = ollama_via_openai.chat.completions.create(\n",
- " model=MODEL,\n",
- " messages=messages\n",
- ")\n",
- "\n",
- "print(response.choices[0].message.content)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "1622d9bb-5c68-4d4e-9ca4-b492c751f898",
- "metadata": {},
- "source": [
- "# NOW the exercise for you\n",
- "\n",
- "Take the code from day1 and incorporate it here, to build a website summarizer that uses Llama 3.2 running locally instead of OpenAI; use either of the above approaches."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "402d5686-4e76-4110-b65a-b3906c35c0a4",
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3 (ipykernel)",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.11.11"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/week1/day2 EXERCISE_llama_on_my_web_page.ipynb b/week1/day2 EXERCISE_llama_on_my_web_page.ipynb
new file mode 100644
index 0000000..40d60b0
--- /dev/null
+++ b/week1/day2 EXERCISE_llama_on_my_web_page.ipynb
@@ -0,0 +1,714 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "d15d8294-3328-4e07-ad16-8a03e9bbfdb9",
+ "metadata": {},
+ "source": [
+ "# Welcome to your first assignment!\n",
+ "\n",
+ "Instructions are below. Please give this a try, and look in the solutions folder if you get stuck (or feel free to ask me!)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ada885d9-4d42-4d9b-97f0-74fbbbfe93a9",
+ "metadata": {},
+ "source": [
+ "\n",
+ " \n",
+ " \n",
+ " \n",
+ " | \n",
+ " \n",
+ " Just before we get to the assignment --\n",
+ " I thought I'd take a second to point you at this page of useful resources for the course. This includes links to all the slides. \n",
+ " https://edwarddonner.com/2024/11/13/llm-engineering-resources/ \n",
+ " Please keep this bookmarked, and I'll continue to add more useful links there over time.\n",
+ " \n",
+ " | \n",
+ "
\n",
+ "
"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6e9fa1fc-eac5-4d1d-9be4-541b3f2b3458",
+ "metadata": {},
+ "source": [
+ "# HOMEWORK EXERCISE ASSIGNMENT\n",
+ "\n",
+ "Upgrade the day 1 project to summarize a webpage to use an Open Source model running locally via Ollama rather than OpenAI\n",
+ "\n",
+ "You'll be able to use this technique for all subsequent projects if you'd prefer not to use paid APIs.\n",
+ "\n",
+ "**Benefits:**\n",
+ "1. No API charges - open-source\n",
+ "2. Data doesn't leave your box\n",
+ "\n",
+ "**Disadvantages:**\n",
+ "1. Significantly less power than Frontier Model\n",
+ "\n",
+ "## Recap on installation of Ollama\n",
+ "\n",
+ "Simply visit [ollama.com](https://ollama.com) and install!\n",
+ "\n",
+ "Once complete, the ollama server should already be running locally. \n",
+ "If you visit: \n",
+ "[http://localhost:11434/](http://localhost:11434/)\n",
+ "\n",
+ "You should see the message `Ollama is running`. \n",
+ "\n",
+ "If not, bring up a new Terminal (Mac) or Powershell (Windows) and enter `ollama serve` \n",
+ "And in another Terminal (Mac) or Powershell (Windows), enter `ollama pull llama3.2` \n",
+ "Then try [http://localhost:11434/](http://localhost:11434/) again.\n",
+ "\n",
+ "If Ollama is slow on your machine, try using `llama3.2:1b` as an alternative. Run `ollama pull llama3.2:1b` from a Terminal or Powershell, and change the code below from `MODEL = \"llama3.2\"` to `MODEL = \"llama3.2:1b\"`"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "4e2a9393-7767-488e-a8bf-27c12dca35bd",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# imports\n",
+ "\n",
+ "import requests\n",
+ "from bs4 import BeautifulSoup\n",
+ "from IPython.display import Markdown, display"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "29ddd15d-a3c5-4f4e-a678-873f56162724",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Constants\n",
+ "\n",
+ "OLLAMA_API = \"http://localhost:11434/api/chat\"\n",
+ "HEADERS = {\"Content-Type\": \"application/json\"}\n",
+ "MODEL = \"llama3.2\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "dac0a679-599c-441f-9bf2-ddc73d35b940",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Create a messages list using the same format that we used for OpenAI\n",
+ "\n",
+ "messages = [\n",
+ " {\"role\": \"user\", \"content\": \"Describe some of the business applications of Generative AI\"}\n",
+ "]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "7bb9c624-14f0-4945-a719-8ddb64f66f47",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "payload = {\n",
+ " \"model\": MODEL,\n",
+ " \"messages\": messages,\n",
+ " \"stream\": False\n",
+ " }"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "479ff514-e8bd-4985-a572-2ea28bb4fa40",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Let's just make sure the model is loaded\n",
+ "\n",
+ "!ollama pull llama3.2"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "42b9f644-522d-4e05-a691-56e7658c0ea9",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Generative AI has numerous business applications across various industries. Here are some examples:\n",
+ "\n",
+ "1. **Content Creation**: Generative AI can generate high-quality content such as:\n",
+ "\t* Articles and blog posts\n",
+ "\t* Social media posts and captions\n",
+ "\t* Product descriptions and e-commerce content\n",
+ "\t* Music and audio tracks\n",
+ "2. **Product Design and Development**: Generative AI can assist in product design, prototyping, and development by:\n",
+ "\t* Generating 3D models and CAD designs\n",
+ "\t* Creating prototypes and mockups\n",
+ "\t* Optimizing product performance and functionality\n",
+ "3. **Marketing and Advertising**: Generative AI can help with marketing and advertising efforts by:\n",
+ "\t* Generating personalized ad copy and landing pages\n",
+ "\t* Creating social media ads and promotions\n",
+ "\t* Analyzing customer behavior and sentiment to inform marketing strategies\n",
+ "4. **Data Analysis and Visualization**: Generative AI can aid in data analysis and visualization by:\n",
+ "\t* Generating insights and recommendations from large datasets\n",
+ "\t* Creating visualizations and reports to communicate findings\n",
+ "\t* Identifying patterns and trends in complex data\n",
+ "5. **Customer Service and Support**: Generative AI can be used to power chatbots and virtual assistants that:\n",
+ "\t* Provide customer support and answer frequently asked questions\n",
+ "\t* Route customers to human representatives when needed\n",
+ "\t* Analyze customer feedback and sentiment to improve service\n",
+ "6. **Personalized Recommendations**: Generative AI can generate personalized product recommendations for e-commerce platforms, streaming services, and more.\n",
+ "7. **Content Moderation and Review**: Generative AI can assist in content moderation by:\n",
+ "\t* Analyzing online content for hate speech, harassment, or explicit material\n",
+ "\t* Generating reviews and ratings for products or services\n",
+ "8. **Supply Chain Optimization**: Generative AI can help optimize supply chains by:\n",
+ "\t* Predicting demand and inventory levels\n",
+ "\t* Identifying bottlenecks and inefficiencies in logistics and transportation\n",
+ "9. **Financial Analysis and Modeling**: Generative AI can aid in financial analysis and modeling by:\n",
+ "\t* Generating forecasts and predictions for sales, revenue, and expenses\n",
+ "\t* Analyzing financial data to identify trends and patterns\n",
+ "10. **Creative Writing and Copywriting**: Generative AI can generate high-quality creative writing and copywriting content, such as:\n",
+ "\t* Blog posts and articles\n",
+ "\t* Social media posts and captions\n",
+ "\t* Advertisements and marketing materials\n",
+ "\n",
+ "These are just a few examples of the many business applications of Generative AI. As the technology continues to evolve, we can expect to see even more innovative uses in various industries.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# If this doesn't work for any reason, try the 2 versions in the following cells\n",
+ "# And double check the instructions in the 'Recap on installation of Ollama' at the top of this lab\n",
+ "# And if none of that works - contact me!\n",
+ "\n",
+ "response = requests.post(OLLAMA_API, json=payload, headers=HEADERS)\n",
+ "print(response.json()['message']['content'])"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6a021f13-d6a1-4b96-8e18-4eae49d876fe",
+ "metadata": {},
+ "source": [
+ "# Introducing the ollama package\n",
+ "\n",
+ "And now we'll do the same thing, but using the elegant ollama python package instead of a direct HTTP call.\n",
+ "\n",
+ "Under the hood, it's making the same call as above to the ollama server running at localhost:11434"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "7745b9c4-57dc-4867-9180-61fa5db55eb8",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Generative AI has numerous business applications across various industries. Here are some examples:\n",
+ "\n",
+ "1. **Content Generation**: Generative AI can be used to generate high-quality content such as articles, social media posts, product descriptions, and even entire books. This can help businesses save time and resources while maintaining a consistent tone and style.\n",
+ "2. **Product Design**: Generative AI can aid in the design of products such as 3D models, logos, and packaging designs. It can also be used to generate new product ideas based on existing product lines.\n",
+ "3. **Marketing Campaigns**: Generative AI can help create personalized marketing campaigns by generating targeted content, social media posts, and even entire ad campaigns.\n",
+ "4. **Image and Video Generation**: Generative AI can be used to generate high-quality images and videos for businesses such as e-commerce websites, social media platforms, and advertising agencies.\n",
+ "5. **Customer Service Chatbots**: Generative AI-powered chatbots can provide personalized customer service experiences by generating responses based on the customer's query or intent.\n",
+ "6. **Financial Analysis**: Generative AI can be used to analyze financial data, generate forecasts, and even create investment strategies for businesses and investors.\n",
+ "7. **Supply Chain Optimization**: Generative AI can help optimize supply chain operations by predicting demand, identifying bottlenecks, and optimizing logistics.\n",
+ "8. **Human Resources Management**: Generative AI can aid in HR tasks such as talent acquisition, resume screening, and employee performance analysis.\n",
+ "9. **Cybersecurity Threat Detection**: Generative AI-powered systems can detect and predict cyber threats by analyzing network traffic, system logs, and other data sources.\n",
+ "10. **Data Journalism**: Generative AI can be used to generate leads for investigative journalism projects, analyze large datasets, and even create visualizations of complex data.\n",
+ "\n",
+ "Some industries that are heavily impacted by generative AI include:\n",
+ "\n",
+ "1. **Media and Entertainment**: Generative AI is being used in content creation, music production, and video editing.\n",
+ "2. **E-commerce**: Generative AI can aid in product design, image generation, and customer service chatbots.\n",
+ "3. **Finance and Banking**: Generative AI can be used for financial analysis, risk assessment, and portfolio optimization.\n",
+ "4. **Healthcare**: Generative AI is being used to analyze medical data, generate new treatments, and optimize patient outcomes.\n",
+ "5. **Manufacturing**: Generative AI can aid in product design, supply chain optimization, and predictive maintenance.\n",
+ "\n",
+ "Overall, generative AI has the potential to transform businesses across various industries by automating repetitive tasks, providing new insights, and enhancing customer experiences.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import ollama\n",
+ "\n",
+ "response = ollama.chat(model=MODEL, messages=messages)\n",
+ "print(response['message']['content'])"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a4704e10-f5fb-4c15-a935-f046c06fb13d",
+ "metadata": {},
+ "source": [
+ "## Alternative approach - using OpenAI python library to connect to Ollama"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "23057e00-b6fc-4678-93a9-6b31cb704bff",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Generative AI has numerous business applications across various industries, including:\n",
+ "\n",
+ "1. **Content Creation**: Generative AI can generate high-quality content such as text, images, and videos, reducing the need for manual labor and increasing efficiency.\n",
+ "2. **Marketing and Advertising**: Generative AI can create personalized marketing campaigns, product recommendations, and ad copy, improving customer engagement and conversion rates.\n",
+ "3. **Product Design**: Generative AI can design products, prototypes, and even entire product lines, streamlining the innovation process and reducing development costs.\n",
+ "4. **Virtual Productization**: Generative AI can generate digital twins of physical products, allowing for testing, iteration, and virtual marketing without the need for physical prototyping.\n",
+ "5. **Chatbots and Customer Service**: Generative AI-powered chatbots can provide personalized customer support, answer frequently asked questions, and handle routine tasks, freeing up human customer service agents to focus on complex issues.\n",
+ "6. **Data Analytics**: Generative AI can analyze large datasets, identify patterns, and predict trends, providing actionable insights for business decision-making.\n",
+ "7. **Predictive Maintenance**: Generative AI can predict equipment failures, schedule maintenance, and optimize resource allocation, reducing downtime and increasing overall efficiency.\n",
+ "8. **Image Recognition**: Generative AI can recognize and classify images, enabling applications such as self-driving cars, security monitoring, and medical diagnosis.\n",
+ "9. **Voice Assistants**: Generative AI can power voice assistants, providing users with personalized recommendations, scheduling appointments, and controlling smart home devices.\n",
+ "10. **Research and Development**: Generative AI can generate hypotheses, simulate experiments, and predict outcomes, accelerating the pace of innovation and discovery.\n",
+ "\n",
+ "Some specific business use cases include:\n",
+ "\n",
+ "* **Automated content writing**: Generative AI can write articles, blog posts, and social media content for news agencies, publishers, and marketing firms.\n",
+ "* **Virtual fashion designers**: Generative AI can design clothing, accessories, and even entire fashion collections, reducing the need for human designers and enabling mass customization.\n",
+ "* **Personal finance advisors**: Generative AI can provide personalized financial planning, budgeting, and investment advice to individuals and businesses.\n",
+ "* **Intelligent transportation systems**: Generative AI can optimize traffic flow, predict maintenance needs, and improve overall safety and efficiency in urban areas.\n",
+ "\n",
+ "These are just a few examples of the many business applications of Generative AI. As the technology continues to evolve, we can expect to see even more innovative solutions emerge across various industries.\n"
+ ]
+ }
+ ],
+ "source": [
+ "# There's actually an alternative approach that some people might prefer\n",
+ "# You can use the OpenAI client python library to call Ollama:\n",
+ "\n",
+ "from openai import OpenAI\n",
+ "ollama_via_openai = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')\n",
+ "\n",
+ "response = ollama_via_openai.chat.completions.create(\n",
+ " model=MODEL,\n",
+ " messages=messages\n",
+ ")\n",
+ "\n",
+ "print(response.choices[0].message.content)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1622d9bb-5c68-4d4e-9ca4-b492c751f898",
+ "metadata": {},
+ "source": [
+ "# NOW the exercise for you\n",
+ "\n",
+ "Take the code from day1 and incorporate it here, to build a website summarizer that uses Llama 3.2 running locally instead of OpenAI; use either of the above approaches."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "402d5686-4e76-4110-b65a-b3906c35c0a4",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "class Website:\n",
+ " \n",
+ " def __init__(self, url):\n",
+ " \n",
+ " self.url = url\n",
+ " HEADERS = {\"Content-Type\": \"application/json\"}\n",
+ " response = requests.get(self.url, headers = HEADERS)\n",
+ " soup = BeautifulSoup(response.content, \"html.parser\")\n",
+ " \n",
+ " self.title = soup.title.string if soup.title else \"No Title Found!\"\n",
+ " \n",
+ " for item in soup.body([\"img\",\"script\",\"style\",\"input\"]):\n",
+ " item.decompose() \n",
+ " \n",
+ " self.text = soup.body.get_text(separator=\"\\n\", strip=True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "5f4bc0a1",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Kanit Vural | Data Scientist & ML Engineer\n",
+ "Home\n",
+ "About\n",
+ "Skills\n",
+ "Projects\n",
+ "Blog\n",
+ "Contact\n",
+ "Kanıt Vural\n",
+ "|\n",
+ "Transforming data into actionable insights and building intelligent solutions\n",
+ "Get in Touch\n",
+ "About Me\n",
+ "Data Scientist & Mine Research & Development Engineer with expertise in AI-driven solutions\n",
+ "He began his career in 2008 at Erdemir Mining Company as a Mining R&D Engineer, part of Oyak Mining Metallurgy Group in Divriği, Turkey. Early on, he worked on geophysical gravity and magnetic iron ore exploration and learned Surpac software to create 3D solid models from drill data. He enhanced his skills in Geostatistics through training at Hacettepe University.\n",
+ "With this expertise, he created block models and conducted reserve classifications, improving the company’s cost-efficiency and profits. He played a key role in discovering new fields and developing existing reserves, contributing to significant financial gains.\n",
+ "In 2020, he joined Tosyalı Iron Steel Angola, a subsidiary of Tosyalı Holding, in Jamba, Angola. He continued reserve classifications using Datamine software and discovered new iron and gold fields. He also mentored junior engineers by providing Datamine training.\n",
+ "Software has always been his passion, starting in high school and continuing throughout his career. He pursued courses in web development, mobile app development, cybersecurity, and data science, eventually discovering his true passion for data science. He took a career break to intensively train in this field, and continues to learn and work on projects daily.\n",
+ "Key Achievements\n",
+ "Discovered iron ore deposits totaling more than 300 million tons across multiple sites.\n",
+ "Applied AI-driven approaches to his work, boosting efficiency.\n",
+ "Passionately mentored junior engineers, empowering them to grow and reach their full potential.\n",
+ "With all the knowledge and experience gained over 15 years, he is ready to create added value by applying it in both the mining and IT industries.\n",
+ "Download CV\n",
+ "GitHub\n",
+ "AI/ML\n",
+ "Cloud\n",
+ "Data\n",
+ "MLOps\n",
+ "Skills & Expertise\n",
+ "Data Analysis\n",
+ "Statistical Analysis\n",
+ "Data Visualization\n",
+ "CRM Analytics\n",
+ "Machine & Deep Learning\n",
+ "Machine Learning Models\n",
+ "Computer Vision\n",
+ "Natural Language Processing\n",
+ "Cloud & Infrastructure\n",
+ "AWS Services\n",
+ "MLOps\n",
+ "Data Engineering\n",
+ "Generative AI\n",
+ "Large Language Models\n",
+ "Prompt Engineering\n",
+ "AI Applications\n",
+ "Mine Research & Development\n",
+ "Mine Exploration\n",
+ "Geostatistics\n",
+ "Solid & Block Modeling\n",
+ "Technologies I Work With\n",
+ "Python\n",
+ "NumPy\n",
+ "Pandas\n",
+ "Scikit-learn\n",
+ "TensorFlow\n",
+ "PyTorch\n",
+ "PySpark\n",
+ "Power BI\n",
+ "ChatGPT\n",
+ "Claude\n",
+ "LangChain\n",
+ "HuggingFace\n",
+ "FastAPI\n",
+ "Streamlit\n",
+ "Gradio\n",
+ "PostgreSQL\n",
+ "MLflow\n",
+ "Docker\n",
+ "Kubernetes\n",
+ "Git\n",
+ "GitHub\n",
+ "Red Hat\n",
+ "Jenkins\n",
+ "AWS\n",
+ "Terraform\n",
+ "Hadoop\n",
+ "Kafka\n",
+ "Airflow\n",
+ "JavaScript\n",
+ "Node.js\n",
+ "Datamine\n",
+ "Surpac\n",
+ "Qgis\n",
+ "Featured Projects\n",
+ "Smile-Based Face Recognition Access Control System\n",
+ "A facial recognition application using AWS infrastructure that activates with your smile and grants\n",
+ " access to registered users. Features email notifications, entry logging, and optional ChatGPT\n",
+ " integration.\n",
+ "AWS\n",
+ "Terraform\n",
+ "Python\n",
+ "Face Recognition\n",
+ "Learn More\n",
+ "Voice2Image AI Generator\n",
+ "An innovative application that transforms voice into images using AI. Record your voice to generate\n",
+ " text via\n",
+ " OpenAI's Whisper, create images with DALL·E, and enhance results using Gemini 1.5 Pro for\n",
+ " regeneration.\n",
+ "OpenAI\n",
+ "DALL·E\n",
+ "Python\n",
+ "Gemini\n",
+ "Learn More\n",
+ "Chat with YouTube Video\n",
+ "A powerful application that allows you to interact with YouTube videos by converting them into text\n",
+ " and asking\n",
+ " questions about their content. Uses OpenAI's Whisper for speech-to-text, LangChain's RAG for Q&A, and\n",
+ " Gemini\n",
+ " Pro for chat.\n",
+ "OpenAI Whisper\n",
+ "LangChain\n",
+ "Gemini Pro\n",
+ "Streamlit\n",
+ "Learn More\n",
+ "Data Analyzer with LLM Agents\n",
+ "An intelligent application that analyzes CSV files using advanced language models. Features automatic\n",
+ " descriptive statistics, data visualization, and LLM-powered Q&A about datasets. Supports multiple\n",
+ " models like\n",
+ " Gemini, Claude, and GPT.\n",
+ "LangChain\n",
+ "Streamlit\n",
+ "Data Analysis\n",
+ "LLM Agents\n",
+ "Learn More\n",
+ "Evolution of Sentiment Analysis\n",
+ "A comprehensive exploration of NLP techniques from rule-based to transformer models, analyzing IMDB\n",
+ " reviews.\n",
+ " Features machine learning, deep learning (LSTM, CNN), and BERT implementations with detailed\n",
+ " performance comparisons.\n",
+ "NLP\n",
+ "BERT\n",
+ "Deep Learning\n",
+ "TensorFlow\n",
+ "Learn More\n",
+ "Fish Species Classification with ANN\n",
+ "An image classification project using Artificial Neural Networks to identify 9 different fish\n",
+ " species. Features\n",
+ " smart cropping, PCA dimensionality reduction, and K-means clustering for image preprocessing,\n",
+ " achieving 91%\n",
+ " accuracy.\n",
+ "TensorFlow\n",
+ "Computer Vision\n",
+ "Neural Networks\n",
+ "Image Processing\n",
+ "Learn More\n",
+ "Cardiovascular Disease Prediction\n",
+ "A machine learning model for predicting cardiovascular diseases using patient attributes. Features\n",
+ " MLflow for\n",
+ " model tracking, Gradio for UI, and FastAPI backend. Analyzes various health metrics including ECG\n",
+ " results,\n",
+ " blood pressure, and cholesterol levels.\n",
+ "MLflow\n",
+ "FastAPI\n",
+ "Gradio\n",
+ "Machine Learning\n",
+ "Learn More\n",
+ "Vegetable Image Classification\n",
+ "A deep learning project that classifies 15 different types of vegetables using transfer learning with\n",
+ " EfficientNet B0. Features a Gradio interface for easy interaction, PyTorch implementation, and high\n",
+ " accuracy\n",
+ " image recognition.\n",
+ "PyTorch\n",
+ "EfficientNet\n",
+ "Gradio\n",
+ "Transfer Learning\n",
+ "Learn More\n",
+ "CRM Analytics & Customer Segmentation\n",
+ "A comprehensive CRM analysis project featuring cohort analysis, customer lifetime value prediction\n",
+ " using\n",
+ " BG-NBD and Gamma-Gamma models, RFM analysis, and purchase propensity prediction. Includes customer\n",
+ " segmentation and targeted marketing strategies.\n",
+ "Customer Analytics\n",
+ "Machine Learning\n",
+ "RFM Analysis\n",
+ "CLTV Prediction\n",
+ "Learn More\n",
+ "Amazon Multi-Model Analysis\n",
+ "A comprehensive project combining sentiment analysis (LSTM with self-attention), image classification\n",
+ " (EfficientNetB0), and recommendation systems. Features transfer learning, BERT embeddings, and\n",
+ " FAISS/ChromaDB\n",
+ " for similarity search.\n",
+ "Deep Learning\n",
+ "BERT\n",
+ "AWS\n",
+ "TensorFlow\n",
+ "Learn More\n",
+ "Latest Blog Posts\n",
+ "Tracing the Evolution of Natural Language Processing Through Sentiment Analysis\n",
+ "An exploration of NLP's journey and its applications in sentiment\n",
+ " analysis...\n",
+ "Read on Medium\n",
+ "Building a Smile-Based Access Control System Using AWS\n",
+ "Let your smile be your password - A unique approach to access\n",
+ " control\n",
+ " using AWS services and facial recognition...\n",
+ "Read on Medium\n",
+ "Get in Touch\n",
+ "Interested in collaboration? Let's connect!\n",
+ "[email protected]\n",
+ "© 2025 Kanıt Vural. All rights reserved.\n"
+ ]
+ }
+ ],
+ "source": [
+ "kanit = Website(\"https://kanitvural.com\")\n",
+ "print(kanit.title)\n",
+ "print(kanit.text)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "c5e0d4e9",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "system_prompt = \"You are an assistant that analyzes the contents of a website \\\n",
+ "and provides a short summary, ignoring text that might be navigation related. \\\n",
+ "Respond in markdown.\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "a6256788",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def user_prompt_for(website):\n",
+ " user_prompt = f\"You are looking at a website titled {website.title}\"\n",
+ " user_prompt += \"\\nThe contents of this website is as follows; \\\n",
+ "please provide a short summary of this website in markdown. \\\n",
+ "If it includes news or announcements, then summarize these too.\\n\\n\"\n",
+ " user_prompt += website.text\n",
+ " return user_prompt"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "280d319c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def messages_for(website):\n",
+ " return [\n",
+ " {\"role\": \"system\", \"content\": system_prompt},\n",
+ " {\"role\": \"user\", \"content\": user_prompt_for(website)}\n",
+ " ]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "696c6316",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "\n",
+ "MODEL = \"llama3.2\"\n",
+ "ollama_via_openai = OpenAI(base_url='http://localhost:11434/v1', api_key='ollama')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "id": "da1928f8",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def summarize(url):\n",
+ " website = Website(url)\n",
+ " response = ollama_via_openai.chat.completions.create(\n",
+ " model=MODEL,\n",
+ " messages=messages_for(website)\n",
+ " )\n",
+ " return response.choices[0].message.content\n",
+ "\n",
+ "def display_summary(url):\n",
+ " summary = summarize(url)\n",
+ " display(Markdown(summary))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "id": "4b87d41d",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/markdown": [
+ "### Summary of Kanit Vural's Website\n",
+ "\n",
+ "Kanit Vural is a Data Scientist & ML Engineer with expertise in AI-driven solutions. His website provides an overview of his skills, experience, and projects.\n",
+ "\n",
+ "#### Key Insights\n",
+ "\n",
+ "* **15+ years of experience**: Starting as a Mining R&D Engineer in 2008.\n",
+ "* **Strong foundation in geostatistics** through Hacettepe University training.\n",
+ "* **Wide range of technologies**: Python, NumPy, Pandas, Scikit-learn, TensorFlow, PyTorch, and more.\n",
+ "* **Variety of projects**:\n",
+ "\t+ Face recognition application\n",
+ "\t+ Voice-to-image converter using AI\n",
+ "\t+ Chatbot for YouTube videos\n",
+ "\t+ Intelligent data analysis with LLM agents\n",
+ "\t+ Comprehensive exploration of sentiment analysis and NLP techniques.\n",
+ "\n",
+ "#### Featured Projects\n",
+ "\n",
+ "1. Smile-Based Face Recognition Access Control System\n",
+ "2. Data Analyzer with LLM Agents\n",
+ "3. Evolution of Sentiment Analysis\n",
+ "4. Fish Species Classification with ANN\n",
+ "5. Cardiovascular Disease Prediction\n",
+ "6. Vegetable Image Classification\n",
+ "7. CRM Analytics & Customer Segmentation\n",
+ "8. Amazon Multi-Model Analysis"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "display_summary(\"https://kanitvural.com\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "9f072c77",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "venv",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.12.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}