## Aplikacja Analytic Inbox ##
```
python web/index.py
```

## Wyznaczanie powiązanych adresów e-mail ##
```
pig -l /tmp -x local -v -w related_email_addresses.pig
```
Polecenie to utworzy bazę mongodb: 'mongodb://localhost/agile_data.related_addresses'


## Sprawdzanie zawartości MongoDB ##

Patrz 'mongo.js'


## Poprawianie rozkładu w Pigu ##

W konsoli Mongo wpisz:
```
use agile_data
db.sent_distributions.drop();
```

Potem uruchom skrypt Pig:
```
pig -l /tmp -x local -v -w ./sent_distributions_fix.pig
```

## Wyodrębnianie tematów z wiadomości i według adresów ##
```
cd pig
pig -l /tmp -x local -v -w topics.pig
pig -l /tmp -x local -v -w process_topics.pig
pig -l /tmp -x local -v -w publish_topics.pig
```

## Weryfikacja danych w MongoDB ##

W konsoli Mongo:
```
use agile_data
db.topics_per_email.ensureIndex({'message_id': 1});
db.topics_per_email.findOne();
db.topics_per_email.findOne();
db.topics_per_email.findOne({'message_id': 'CANSvDjrA-dea9T-iZ6wJOLBP_Kqriae3FMDasU2OxO0gfzxJjg@mail.gmail.com'})
{
	"_id" : ObjectId("510ef2803004df85dba4ec3a"),
	"message_id" : "CANSvDjrA-dea9T-iZ6wJOLBP_Kqriae3FMDasU2OxO0gfzxJjg@mail.gmail.com",
	"topics" : [
		{
			"word" : "grass",
			"score" : 0.31845143365191986
		},
		{
			"word" : "plant",
			"score" : 0.2810330077326449
		},
		{
			"word" : "rye",
			"score" : 0.20285020154575548
		},
		{
			"word" : "sack",
			"score" : 0.19571670266698085
		},
		{
			"word" : "topsoil",
			"score" : 0.19381049907089434
		},
		{
			"word" : "warms",
			"score" : 0.19207027153110176
		},
		{
			"word" : "turf",
			"score" : 0.1889872579345566
		},
		{
			"word" : "weeds",
			"score" : 0.16849717160426886
		},
		{
			"word" : "winter",
			"score" : 0.13641124134559518
		},
		{
			"word" : "dad",
			"score" : 0.12483962902570728
		}
	]
}
```
