Skip to content

kiddkevin00/Python-Backend___TrendyWriter-API

Repository files navigation

NOTE (MongoDB)

functions to insert clusters and single words into mongodb

Files required:

  1. part-r-00000(pig word count result)
  2. topics_clusters_dump
  3. hottest_words.txt

how to run:

  1. Crate folders under the result folder using the name of fields (news, for example, is used in the test case) run insert.py with the name of fields as argument, it will automatically search for the result/{field_name}/ folder for files
  2. Run server.py when insertion complete, default port: 9000

how to query:

  1. Query 1
    • HTTP Request 1: localhost:9000/query?field=news
    • HTTP Response 1: Return a list of top words. if the word is included in clustering, you can also find cluster names in the JSON object also returns a list of top phrases
  2. Query 2
    • HTTP Request 2: localhost:9000/cluster?field=news&cname=VL-183
    • HTTP Response 2: Return a list of words in a specific cluster

About

Developed RESTful APIs powering Android and web applications to deliver real-time trending topics, leveraging Python (Flask) and MongoDB, and integrating with big data pipelines using Pig, Mahout, and Python (NLTK).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors