Professional Documents
Culture Documents
City/place Rankings Based On Semantic Tracking Through Online Media
City/place Rankings Based On Semantic Tracking Through Online Media
City/place Rankings Based On Semantic Tracking Through Online Media
Supervisor:
Ms. Shahela Saif
Scope
Modules
Data Extraction:Data will be gathered from
multiple sources and extract the required
information from it. Data gathering shall be done
periodically and automatically by using
crawler/scrapper.
Data analysis: Sentiment analysis will be
perform on data and sentiment polarity will be
assigned such as positive, negative and neutral.
Modules
Data representation: Results will be
Mockups
APIs/Libraries
Request.js: Helps us make Http
requests.
Cheerio: Implementation of core
jQuery specifically for the server
(helps us traverse the DOM and
extract data).
Express.js: A framework for Nodes.js
that adds more features to Node.js.
Dattumbox API:
System Architecture
3-tier architecture will be used for the
system.
Presentation tier
Logic tier
Data tier
A physically separate middle-tier adds an
extra level of security to avoid giving direct
access of database to the user.
Design Methodology
Object-Oriented design methodology will
be followed. OOP methodology provides:
Reusability
Maintainability
Modularity and easy debugging. Each class
contains appropriate objects and methods.
Prototyping as software process model.
Reason is it reduces inherent project risk by
breaking a project into smaller segments
and providing more ease-of-change during
the development process.
Data Representation
Class Diagram
Sequence Diagram
Algorithm &
Implementation
Generate_Ranking(city) {
var city,word,sent_pol;
var URL = require('http://www.twitter.com');
Dattumbox_API();
Scrapper();
Print(city,word,sent_pol);
}
Dattumbox_API() {
datum.twitterSentimentAnalysis("Canyoufindmy#sentiments#please?",f
unction(err,data){
if(err)
returnconsole.log(err);
console.log (data);});
}
Algorithm &
Implementation
Scrapper() {
request("https://www.twitter.com", function(error, response, body) {
if(error) {
console.log("Error: " + error);
}
console.log("Status code: " + response.statusCode);
var $ = cheerio.load(body);
$('div#siteTable > div.link').each(function( index ) {
var city = $(this).find('p.title > a.title').text().trim();
Dattumbox_API( WORD, sent_pol) ;
console.log("City: " + city);
console.log("Word: " + word);
console.log("Sentiment_polarity: " + sent_pol); });
Print(city,word,sent_pol){
fs.appendFile('output.json', "City:" + city + '\n' + "Word:" + word+ '\n' + "Sentiment_polarity:"
+ sent_pol + '\n');
});
}
Question and
Answers