Skip to content

NNSAT : A Python-based GUI application that searches for and analyzes potential negative news about customers using Google Custom Search API and sentiment analysis.

Notifications You must be signed in to change notification settings

aamitn/negative-news

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nnsat-logo

Negative News Search and Analysis Tool - NNSAT

nnsat-screenshot

A Python-based GUI application that searches for and analyzes potential negative news about customers using Google Custom Search API and sentiment analysis.

Features

  • Custom Google search with specified keywords
  • Multi-language and custom search keywords support
  • Configurable languages, keywords, exclusions and more using json based config
  • Sentiment analysis of search results
  • Risk scoring and categorization based on Sentiment scores for each result
  • Interactive GUI with Raw JSON response viewer
  • Automatic browser opening for high-risk results
  • Uses Curl CFFI for access to all kinds of URLs
  • Support Parsing of PDF and DOCx files in URLs

Prerequisites

  • Python 3.x
  • Google Custom Search API credentials
  • Internet connection

Prebuilt Windows Binary (With our provided search API Keys and CX)

Installation

  1. Clone the repository

    git clone https://github.com/aamitn/negative-news
  2. Install required dependencies:

    pip install -r requirements.txt
  3. Set up Google Custom Search API:

    1. Create Custom Search Engine:

    2. Get API Key (choose one method):

  4. Configure Application:

    • Create config.json in project root
    • Add your API credentials creted in step 3

Configuration

Create a config.json file in the project root with the following structure:

{
    "google_search_api_key": "YOUR_GOOGLE_SEARCH_API_KEY",
    "google_search_cx": "YOUR_GOOGLE_CUSTOM_SEARCH_CX",   

    "pdf_max_pages": 5,
    "docx_max_paragraphs" : 50,
    "max_chars" : 1000,

    "total_results": 10,

    "connection_timeout":5,
    "read_timeout": 5,
    "max_retries": 2,
    
    "curl_cffi_impersonator": "chrome",

    "languages_keywords": {
        "English": ["bribery", "fraud", "money laundering", "crime", "terrorism", "corruption"],
        "Spanish": ["soborno", "fraude", "lavado de dinero", "crimen", "terrorismo", "corrupción"],
        "yourlang":["custom_key1","key2"]
    },

    "default_selected_languages": ["English"],

    "excluded_sites": ["facebook.*", "twitter.*", "instagram.*", "linkedin.*", "reddit.*"]
}

Usage

  1. Run the application:
python app.py
  1. Enter the customer name in the search field
  2. Select the desired languages for search
  3. Click "Search and Analyze"
  4. View results in the Analysis Results tab
  5. Check raw API responses in the Raw Response tab

Generate Executable with pyinstaller

pyinstaller --noconfirm --onefile --windowed --icon "C:\Users\bigwiz\PycharmProjects\negative-news\assets\logo.ico"  "C:\Users\bigwiz\PycharmProjects\negative-news\app.py"

Troubleshooting

  • SSL Certificate issues: The application uses a local cacert.pem file for SSL verification
  • If you encounter connection issues, check your internet connection and API credentials
  • Ensure all required Python packages are installed correctly

About

NNSAT : A Python-based GUI application that searches for and analyzes potential negative news about customers using Google Custom Search API and sentiment analysis.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages