Giter Site home page Giter Site logo

hellgrenj / mediaspin Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 20.39 MB

Daily sentiment analysis of Swedish news

Home Page: https://mediaspin.johanhellgren.se

Dockerfile 1.28% C# 75.85% JavaScript 7.03% HTML 7.21% CSS 3.24% Vue 5.06% TypeScript 0.32%

mediaspin's Introduction

MediaSpin

Prerequisites

You need to have the following tech installed locally:

  • dotnet core 3.1 (LTS)
  • node 12.16 (LTS)
  • docker version 18.x.
  • docker-compose version 1.23.x.

Start the system

  • clone this repo
  • run npm install in /scripts
  • run node scripts/setup
  • run docker-compose up

Test

run node script/run-all-unit-tests.js

Grow the dataset and re-train the model

First run the system and let tracker execute a full article fetch. Make sure that tracker has the writeArticlesToFile env var set to true. Then navigate to the script folder. In the script folder run

node add-to-dataset-and-re-train-model.js

(more about the dataset under Challanges below)

What and why

The idea is to track how Swedish media reports on different subjects by using sentiment analysis. This hobby project scratches two itches at once for me;

  1. I find the idea interesting
  2. I use this solution to learn, try and evaluate different things ... (hence the overengineering, complex architecture and different versions of a single component)

Conceptual overview

         tracker (tracks and extracts articles containing keywords)  
            |
            |
         analyzer (analyzes sentiment)
            |
            |
         storage (stores analysis)
        /       \          
       /         \
  visualizer     bot

Tech and other stuff in this project

  • Kubernetes (yaml files)
  • Docker & Docker Compose
  • dotnet core 3 (web/service and worker)
  • ML.NET
  • Sentiment (AFINN-based sentiment analysis for Node.js)
  • gRPC
  • NodeServices in .net core (soon to be replaced...)
  • Ef core
  • Postgres
  • RabbitMQ
  • Client side Blazor (WebAssembly) - hence the initial load time :)
  • Vue.js (Currently porting the client, see visualizer2)
  • The mediator pattern (without a library)
  • CQRS
  • Some hexagonal architecture principles in a microservices setting

Challanges

I have not been able to find a good Swedish dataset to train my ML.NET model with. So, for now, I am doing the following:

I am using a Swedish translated AFINN lexicon and word lists I found on Kaggle to generate a dataset from actual articles pulled down by the tracker component.

See /dataset-gen/index.js and scripts/add-to-dataset-and-re-train-model.js and the code in tracker that writes articles to a file to see how this works.

Its actually working better than I thought it would. But the current model still gets it really wrong sometimes so I am using an AFINN server as a safety net (see analyzer - Engine.cs).

mediaspin's People

Contributors

hellgrenj avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

mimustafa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.