Skip to content

Automatically fetches, translates, and summarizes world news from Yahoo! Japan using Google Cloud APIs. Output in JSON or terminal. ๐Ÿ‡ฏ๐Ÿ‡ตโ†’๐Ÿ‡บ๐Ÿ‡ธ

License

Notifications You must be signed in to change notification settings

ty70/news-summary-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

News Summary Translator

This project fetches the latest world news articles from Yahoo! Japan, translates their content from Japanese to English using Google Cloud Translate API, and summarizes the key entities using Google Cloud Natural Language API. The results can be saved as a JSON file or printed to the console.


โšก Features

  • Scrapes latest world news topics from Yahoo! Japan
  • Extracts article content from each news article URL
  • Translates content from Japanese to English using Google Cloud Translation API
  • Extracts key entities for summarization using Google Cloud Natural Language API
  • Supports output to JSON file or standard output (console) using --output option

๐Ÿ“‚ Project Structure

.
โ”œโ”€โ”€ summaries.json (optional)
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ news_scraper.py
โ”‚   โ”œโ”€โ”€ summarizer.py
โ”‚   โ””โ”€โ”€ translator.py

โš™ Requirements

  • Python 3.8+
  • google-cloud-translate
  • google-cloud-language
  • beautifulsoup4
  • requests

Install dependencies:

pip install -r requirements.txt

Set up Google Cloud credentials:

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account.json"

๐Ÿ”ง Usage

python scripts/main.py --output json      # Saves summaries to summaries.json
python scripts/main.py --output console   # Prints summaries to standard output

It will:

  1. Fetch recent article titles and URLs
  2. Extract their content
  3. Translate to English
  4. Summarize key entities
  5. Output results based on --output selection

๐Ÿ“— Output Example (JSON)

[
  {
    "title": "Some Japanese News Title",
    "original": "ๅ…ƒใฎๆ–‡็ซ ...",
    "translated": "The original article translated to English...",
    "summary": "Keywords: Prime Minister, Japan, Trade, Policy"
  }
]

โœ‰ Notes

  • Yahoo! Japan articles may require adjustments due to layout changes.
  • You can switch sources or languages by modifying news_scraper.py and translator.py.
  • The --output flag helps choose between file output and terminal display.

๐Ÿš€ License

MIT License


โœ๏ธ Author

[ty70]

About

Automatically fetches, translates, and summarizes world news from Yahoo! Japan using Google Cloud APIs. Output in JSON or terminal. ๐Ÿ‡ฏ๐Ÿ‡ตโ†’๐Ÿ‡บ๐Ÿ‡ธ

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages