public class DomainGraph extends Object
Constructor and Description |
---|
DomainGraph(Properties prp) |
DomainGraph(String id,
Properties prp,
Graph g,
double p,
double c,
double d,
double a) |
Modifier and Type | Method and Description |
---|---|
void |
domainInitialization(String[] datasets,
HashMap<String,ArrayList<DatasetInstance>> allInstances,
String currentDomain)
Initializes the graph with truth value related to the belonging of each concept to the current domain
|
double |
domainTest(ArrayList<String> features,
HashMap<String,DomainGraph> graphs)
Validates the learned graph on the predicting domain test set
|
double |
domainTest(String currentFeature,
DomainGraph g)
Get the single feature graph polarity
|
void |
forcedPolarityInitialization(String concept,
FuzzyMembership fm)
Initializes the graph with the polarities representing the sentiment of each concept in the current domain
|
Graph |
getGraph() |
Long |
getNextNodeId() |
HashMap<Long,FuzzyMembership> |
getPolarities() |
SerializableDomainGraph |
getSerializableDomainGraph()
Produces a serializable version of the DomainGraph object
|
void |
polaritiesPropagation()
Computes the fuzzy membership functions of each node of the graph starting from the values read in the dataset
and by propagating them through the entire graph
|
void |
polarityInitialization(ArrayList<DatasetInstance> instances)
Initializes the graph with the polarities representing the sentiment of each concept in the current domain
|
double[] |
polarityTest(ArrayList<DatasetInstance> instances)
Validates the learned graph on the predicting polarity test set
|
ArrayList<DatasetInstance> |
polarityValidation(ArrayList<DatasetInstance> instances)
Validates the learned graph on unknown polarity validation set by returning only the predicted polarity value
|
void |
setDomainGraphFromSerializedData(String modelPath) |
void |
setDomainGraphFromSerializedData(String currentDataset,
String modelPath,
String type)
Initializes the DomainGraph object with serialized data
|
void |
setGraph(Graph graph) |
void |
setIterationResult(long nodeId,
double value)
Saves the new polarity value computed for a node.
|
void |
setPolarities(HashMap<Long,FuzzyMembership> polarities) |
void |
updateCurrentGraphConvergenceValue(double contribution)
Updates the value representing the total polarities update of the graph during the running iteration.
|
void |
updatePolarities(long nodeId,
FuzzyMembership fm) |
public DomainGraph(Properties prp)
public DomainGraph(String id, Properties prp, Graph g, double p, double c, double d, double a)
public void polarityInitialization(ArrayList<DatasetInstance> instances)
instances
- public void forcedPolarityInitialization(String concept, FuzzyMembership fm)
instances
- public void domainInitialization(String[] datasets, HashMap<String,ArrayList<DatasetInstance>> allInstances, String currentDomain)
datasets
- the list of the domainsinstances
- the list of the training instances for each domaincurrentDomain
- the current domainpublic void polaritiesPropagation()
public double[] polarityTest(ArrayList<DatasetInstance> instances)
instances
- the set of test instancespublic ArrayList<DatasetInstance> polarityValidation(ArrayList<DatasetInstance> instances)
instances
- the set of test instancespublic double domainTest(ArrayList<String> features, HashMap<String,DomainGraph> graphs)
instances
- the set of test instancespublic double domainTest(String currentFeature, DomainGraph g)
feature
- the feature to analyzepublic Long getNextNodeId()
public void updatePolarities(long nodeId, FuzzyMembership fm)
public void updateCurrentGraphConvergenceValue(double contribution)
contribution
- the contribution given by the changes of each node.public void setIterationResult(long nodeId, double value)
nodeId
- the id of the node.value
- the new polarity value of the node.public SerializableDomainGraph getSerializableDomainGraph()
public void setDomainGraphFromSerializedData(String currentDataset, String modelPath, String type)
public void setDomainGraphFromSerializedData(String modelPath)
public HashMap<Long,FuzzyMembership> getPolarities()
public void setPolarities(HashMap<Long,FuzzyMembership> polarities)
public Graph getGraph()
public void setGraph(Graph graph)
Copyright © 2016–2020 FBK. All rights reserved.