Category: Blog

  • Calendar-Holiday-Countdown

    Event Countdown App

    This is a simple web-based application that allows users to view a countdown to various events. The app dynamically calculates the days remaining to the next occurrence of a set of predefined events (e.g., New Year’s Day, Valentine’s Day, Christmas). The event countdown adjusts based on the current date and always shows the next upcoming event.

    App Image

    Features

    • Displays a list of events with a countdown to the next occurrence.
    • Updates the countdown automatically to show the number of days left.
    • If an event’s date has already passed for the current year, it adjusts to the next year’s event.
    • Responsive design that works on both desktop and mobile devices.

    Events Included

    The app includes the following events:

    • New Year’s Day 🎉
    • Bitcoin’s Birthday 🟠
    • Burns Night 🏴󠁧󠁢󠁳󠁣󠁴󠁿
    • Valentine’s Day 💘
    • St. Patrick’s Day 🍀
    • Spring 🌸
    • Clocks Go Forward (Last Sunday of March) ⏩
    • Easter 🐣
    • April Fool’s Day 🤣
    • Earth Day 🌍
    • Bonfire Night 🎆
    • Pride Month 🏳️‍🌈
    • Summer ☀️
    • App Store Sales 🍏
    • World Emoji Day 📅
    • Autumn 🍂
    • Clocks Go Backward (Last Sunday of October) ⏪
    • Halloween 🎃
    • Remembrance Day 🌍
    • Black Friday Sales 🫰
    • Thanksgiving (US) 🦃
    • Winter ❄️
    • Christmas 🎄

    Technologies Used

    • HTML: For structure and content of the app.
    • CSS: For styling and responsive design.
    • JavaScript: For calculating the days remaining and dynamically updating the event list.

    How to Access

    Access the app HERE

    How It Works

    • The app defines a list of events with specific dates (e.g., 2024-01-01 for New Year’s Day).
    • It calculates the number of days remaining until each event using JavaScript, adjusting for events that have already passed in the current year.
    • The events are displayed in a sorted order, with the nearest event at the top.
    • Each event is displayed with an emoji and the number of days left until the event occurs.

    Days Calculation Logic

    • The app checks if the event date has passed for the current year. If it has, the app calculates the countdown for the same event in the following year.
    • The days remaining are calculated and displayed dynamically.

    Customisation

    To add or modify events, you can update the events array in the script section of the index.html file. The array contains objects with the following properties:

    • emoji: A string representing the emoji associated with the event.
    • name: The name of the event.
    • date: The date of the event in the format YYYY-MM-DD.

    Example:

    { emoji: '🎉', name: 'New Year\'s Day', date: '2024-01-01' }
    Visit original content creator repository https://github.com/kay-who-codes/Calendar-Holiday-Countdown
  • sentiment-analysis-leveraging-lstm

    sentiment-analysis-leveraging-lstm

    Sentiment Analysis is determining whether a written piece of text has a positive, neutral, or negative connotation. These written pieces of text are usually the reviews that are left by customers once they use products, brands, services, and so forth. These reviews give an insight into how appealing or off-putting a particular product, brand, or service was to the customer. These insights are extremely useful because they are not only an indicator of customer satisfaction but also companies can use them to drive business decisions.

    Sentiment Analysis models are built leveraging a deep learning approach utilizing the customer reviews of Amazon products. Since Long Short Term Memory Network (LSTM) is very effective in dealing with long sequence data and learning long-term dependencies, it is used for automatic sentiment classification of future product reviews.

    NOTE: The image above is generated through DALL·E preview app.

    Table of Contents

    Highlights

    Following are the highlights of the project:

    • Sentiment Analysis of Amazon Product Reviews using an imbalanced dataset
    • The initial sentiment model is trained and evaluated using the following sentiment distribution:
      • Positive Reviews: 89.02%
      • Neutral Reviews: 5.09%
      • Negative Reviews: 5.71%
    • Usage of pre-trained GloVe Word Embeddings
    • Explored different settings to build the sentiment model based on the following:
      • Batch Size
      • Number of LSTM Layers
      • Number of Units per LSTM Layer
      • Dropout Values
      • Absence or Presence of Dense Layer before the output layer
      • Epochs
      • Patience during Early Stopping
      • Word Stemming or Lemmatizing
    • Trained and Evaluated additional sentiment models by addressing the imbalance in data using the following methods:
      • Assigned class weights during the model training
      • Used SMOTE to synthetically create the oversampled data
    • Comparison between different sentiment models

    Dataset

    Consumer Reviews of Amazon Products is the dataset that will be used. It has a reasonable dimension i.e. it has over 34,000 consumer reviews for Amazon products like the Kindle, Fire TV Stick, and so forth. The dataset includes basic product information such as name, review title, review text, review rating, and more for each product. The dataset is publicly available on Kaggle.

    In this dataset, the column reviews.rating has values ranging from 1 to 5. These values will be updated so that each of them corresponds to a sentiment. Values 1 and 2 will be treated as a negative sentiment, value 3 will be treated as a neutral sentiment, and values 4 and 5 will be treated as a positive sentiment. Additionally, the column reviews.text holds the reviews.

    Approach

    Exploratory Dataset Analysis is done for the above-mentioned dataset. The text column is cleaned and the data is then split into training, testing, and validation sets. Further, the data is tokenized and padded followed by preparing the word embeddings that helps in setting up the embedding layer for the sentiment model. Evaluation Metric is finalized and different settings are explored to build the sentiment model. Apart from the initial model that is trained and evaluated using the imbalanced data, two other models are built. One of the models is trained using class weights and the other model is trained using synthetically oversampled data. Finally, the results are compared for different models trained and evaluated under the best setting.

    Information About Files

    • dataset/1429_1.csv: Dataset of 34,660 consumer reviews for Amazon products
    • dataset/additional_dataset.txt: Provides links to additional dataset of 5,000 + 28,000 consumer reviews for Amazon
    • screenshot/people-sentiment.png: Screenshot of the people with negative, neutral, and positive facial expressions
    • screenshot/sentiment-distribution.png: Screenshot of the imbalanced dataset
    • screenshot/results.png: Screenshot of a few results
    • sentiment-analysis-lstm.ipynb: Google Colab notebook for the project

    License

    This project is licensed under the MIT License and for more details, see the LICENSE.md file

    References

    Here are some references I looked at while working on this project:

    Papers

    • K. Baktha and B. K. Tripathy, “Investigation of recurrent neural networks in the field of sentiment analysis,” 2017 International Conference on Communication and Signal Processing (ICCSP), 2017, pp. 2047-2050, doi:10.1109/ICCSP.2017.8286763.
    • T. Kati ́c and N. Mili ́cevi ́c, ”Comparing Senti- ment Analysis and Document Representation Meth- ods of Amazon Reviews,” 2018 IEEE 16th Inter- national Symposium on Intelligent Systems and In- formatics (SISY), 2018, pp. 000283-000286, doi: 10.1109/SISY.2018.8524814.
    • J. C. Gope, T. Tabassum, M. M. Mabrur, K. Yu and M. Arifuzzaman, ”Sentiment Analysis of Ama- zon Product Reviews Using Machine Learning and Deep Learning Models,” 2022 International Con- ference on Advancement in Electrical and Electronic Engineering (ICAEEE), 2022, pp. 1-6, doi: 10.1109/ICAEEE54957.2022.9836420.
    • N. Sharm, T. Jain, S. S. Narayan and A. C. Kan- dakar, ”Sentiment Analysis of Amazon Smartphone Reviews Using Machine Learning Deep Learning,” 2022 IEEE International Conference on Data Science and Information System (ICDSIS), 2022, pp. 1-4, doi: 10.1109/ICDSIS55133.2022.9915917.

    Links and Blogs

    End Notes

    Did you find this project useful? Which other setting do you think can be explored? In which other way can the imbalance in this data be handled? Feel free to discuss your experiences on the discussion portal, and I’ll be more than happy to discuss.

    Back to Top

    Visit original content creator repository https://github.com/hardikasnani/sentiment-analysis-leveraging-lstm
  • Clojure-Coin-Line-Game

    Coin Line Game

    A simple 2-player game played as follows: An even number of coins is laid out in a row.
    Taking turns, each player removes the coin on one of the ends of the row. The object is to have the
    highest value in coins when all coins have been taken. Note that a greedy strategy of taking the largestvalue
    end coin is not sufficient.

    Consider this situation:

    5, 25, 10, 1

    In this case, the player should take the 1 on the right end; after the opponent takes either the 5 or the 10,
    the player is guaranteed to get the 25. Simply taking the 5 “because it’s bigger” will result in the
    biggest coin going to the other player.

    Algorithm

    1. If there are an even number of coins: Find the sum of all of the even-numbered coins, and all the odd-numbered coins. If the sum of the odd numbered coins is higher, take the leftmost coin; otherwise take the rightmost.

    2. Minimize loss/maximize gain by evaluating every single possiblity of running the application after either taking the first or the last coin (Implementation choppy and doesn’t work well on large data sets).

    Usage

    Install Lein (https://gist.github.com/technomancy/2395913)

    There are two text files, one with 10 numbers to test the algorithm and one with 10,000 numbers to run the program on.

    To run: ‘lein run filePath’ from project directory

    Example: lein run ‘/Users/jeet/Workspace/Clojure_projects/cs-441-coin-game/resources/10.txt’

    License

    Copyright © 2018 Jeet Das

    Distributed under the Eclipse Public License either version 1.0 or any later version.

    Visit original content creator repository
    https://github.com/jeetdas/Clojure-Coin-Line-Game

  • CS580-Intro-to-Artificial-Intelligence

    All the assignmnemts contains Ipython Notebook

    • which is runnable either using Anaconda’s Jupyter Notebook or using Google Colabs

    Assignmnet1 – > A1

    • The 24-puzzle problem
    1. Breadth-first search (BFS)
    2. Depth-first search (DFS)
    3. Informed search algorithms using
      • h1(x) = number of misplaced tiles
      • h2(x) = sum of the distances of every tile to its goal position.

    Assignmnet2 – > A2

    • Find the global minimum of the Eggholder’s Function
    1. Using Hill Climbing Search.
    2. Using Differential Evolution.
    • Find a solution of the N-queens problem
    1. Using Hill Climbing Search.
    2. Using Genetic Algorithm.

    Assignmnet3 – > A3

    • Your task is to write an AI program to solve the Sudoku puzzle as a constraint satisfaction problem.
    1. Naïve Backtracking Algorithm
    2. Smart Backtracking Algorithm

    Assignmnet4 – > A4

    • Your task is to write an AI program to play Othello with a human player. Your tasks include
    1. Implement an Othello playing interface that one can play the game.
    2. Design a heuristic function for the intermediate states.

    Assignmnet5 – > A5

    • Design a pattern recognition neural network to recognize handwriting digits (0-9).
    1. Encode the data into input and target files for neural network training.
    2. Train the neural network (pattern net) based on your input/output files.

    Project : Traveling Santa Prime Paths

    1. Problem Definition.
      Simply describe the “Traveling Santa Problem – Prime Paths” problem.

    2. Methods
      Provide detailed description on your methods, implementation details (pseudo code, flow chart, etc.),

    3. Results
      Analyze the results you get, for example, how do methods/strategies lead to a better solution? What do you learn from this project? Use figures, charts, and tables to assist your analysis. You can also compare your results with the Kaggle winners.

    4. Conclusions
      Provide your conclusions. Do you achieve your goal? Why or why not? If there a way to do it better?

    Visit original content creator repository
    https://github.com/apurva-modi/CS580-Intro-to-Artificial-Intelligence

  • youtube-app

    This project was bootstrapped with Create React App.

    Available Scripts

    In the project directory, you can run:

    npm start

    Runs the app in the development mode.
    Open http://localhost:3000 to view it in the browser.

    The page will reload if you make edits.
    You will also see any lint errors in the console.

    npm test

    Launches the test runner in the interactive watch mode.
    See the section about running tests for more information.

    npm run build

    Builds the app for production to the build folder.
    It correctly bundles React in production mode and optimizes the build for the best performance.

    The build is minified and the filenames include the hashes.
    Your app is ready to be deployed!

    See the section about deployment for more information.

    npm run eject

    Note: this is a one-way operation. Once you eject, you can’t go back!

    If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

    Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

    You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

    Learn More

    You can learn more in the Create React App documentation.

    To learn React, check out the React documentation.

    Visit original content creator repository
    https://github.com/nubidebs/youtube-app

  • JDI with Sauce test project

    JDI with Sauce test project

    Before running JDI project in Sauce Lab, you need to set up Sauce Lab Credentials

    Set Your Sauce Labs Credentials

    1. Copy your Sauce Labs username and accessKey from the User Settings.

    2. Open a Terminal window (command prompt for Windows) and set your Sauce Labs Environment variables:

      Mac OSX:

      $ export SAUCE_USERNAME="username"
      $ export SAUCE_ACCESS_KEY="accessKey"
      
      Windows:

      > set SAUCE_USERNAME="username"
      > set SAUCE_ACCESS_KEY="accessKey"
      

      To set an environment variables permanently in Windows, you must append it to the PATH variable.

      Go to Control Panel > System > Windows version > Advanced System Settings > Environment Variables > System Variables > Edit > New

      Then set the “Name” and “Value” for each variable

    3. Test the environment variables

      Mac OSX:

      $ echo $SAUCE_USERNAME
      $ echo $SAUCE_ACCESS_KEY
      

      WARNING FOR UNIX USERS!:
      If you have problems setting your environment variables, run the following commands in your terminal:

      $ launchctl setenv SAUCE_USERNAME $SAUCE_USERNAME
      $ launchctl setenv SAUCE_ACCESS_KEY $SAUCE_ACCESS_KEY
      
      Windows:

      > echo %SAUCE_USERNAME%
      > echo %SAUCE_ACCESS_KEY%
      

    Required Sauce Lab Capabilities

    Following capabilities are required for Sauce Lab:

    • username – Sauce Lab username
    • accessKey – Suace Lab access key
    • seleniumVersion – prefered version of Selenium
    • name – test run name

    Here some optional capabilities:

    • maxDuration – how long is the whole test allowed to run
    • commandTimeout – the max time allowed to wait for a Selenium command
    • idleTimeout – how long can the browser wait for a new command

    More optional capabilities can be found here

    JDI options

    In order to run test with Sauce Lab you need set up remote settings in test.properties file.

    remote.type=sauce

    driver.remote.url=https://ondemand.us-west-1.saucelabs.com:443/wd/hub

    See your personal remote url: here look at the ‘Driver Creation’ section.

    Remote url should be different if you are from US.

    And that it. Set Sauce Lab capabilities, set remote execution in test.properties and you can run test with Sauce Lab

    Alternative way to run tests using CLI (you don’t need to set env properties preliminary in your OS)

    mvn -DUSERNAME=your_sauce_user_name -DACCESS_KEY=your_sauce_access_key -Dremote.type=sauce -Dremote.url=your_sauce_remote_url clean install
    mvn allure:serve
    

    Visit original content creator repository
    https://github.com/jdi-templates/jdi-light-saucelabs