## Predict Entity Saliency

### Generate the features (package entity-salientness)

#### Enrich Dataset

For each entity candidate of a spot in the document generate all the features useful to understand its saliency [package]
There are 3 scripts:

* generates the features for only the spots relevant in the given documents ;
* generates the features for only the spots relevant in the given documents, do not consider the title field;
* generates the features for all the spots in the document, if a spot has not relevant entities in the candidates, all the entities will have -1 saliency.

the scripts expect in input a json-file containing a list of rated-documents (it.cnr.isti.hpc.salient.dataset.RatedDocument)
( will convert a dexter-eval json dataset to a list of rated documents, setting relevant entities' saliency to 1)

the scripts will generate a tsv file with a line for each entity, containing the entity, its spots and features

### Train a model for saliency (package predict-saliency)

1. convert the tsv file in a svm file (
2. split the svm in folds (set the dataset folder in and then
3. train: training.svm/tsv model sampling[0,1] -> generate a model, label are casted two binary case (if < 0 and > 0), sampling perform the downsampling of the negative labels, (0.1 random sample the 10% of the ngative labels, 1 does not perform the down sampling).
4. test: test.svm/tsv model test the predictor, prints out accuracy and other stats.

#### Evaluate performance on entity linking: (package predict-saliency - dexter-eval)

1. file.svm model dexter-eval.tsv - predict the labels on the testset and the entity annotated using the labels, generate a results file with the disambiguated entities in dexter-eval.tsv
2. you will need to filter the dexter-eval.json assessment putting only the documents in the golden truth
3. finally in dexter eval run ./scripts/ dexter-eval.tsv golden.json Me ../saliency-predictor/conf-macro-measures.txt output.html to get the performance for the method.