/Python-Backend-Project___TrendyWriter-API

Developing RESTful APIs for front-end app (Android / Web) to retrieve trending topics in real time, using MongoDB, Python/Flask; integrating with Big Data analysis tool, using Pig, Mahout, Python/NLTK.

Primary LanguagePython

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