minor update to selecting randomly strings
This commit is contained in:
parent
ff48940485
commit
bc813e7ba0
@ -456,41 +456,45 @@ public class Datahandler {
|
|||||||
|
|
||||||
private String getResponseFutures(String strF) {
|
private String getResponseFutures(String strF) {
|
||||||
List<String> values_copy = new ArrayList<String>(stringCache.values());
|
List<String> values_copy = new ArrayList<String>(stringCache.values());
|
||||||
int maxsize = values_copy.size() > 500 ? 500 : values_copy.size();
|
|
||||||
Collections.shuffle(values_copy);
|
Collections.shuffle(values_copy);
|
||||||
List<String> strCache = values_copy.subList(0, maxsize);
|
double preRelationUserCounters = -155000.0;
|
||||||
double preRelationUserCounters = -150000.0;
|
double zero = 0.0;
|
||||||
//WHY THE FUCK CANT YOU JUST TRANSFER A SimilarityMatrix OBJECT LIST LIKE ANY OTHER NORMAL COLLECTION, WHY DOES IT HAVE TO BE A FUCKING STRING LIST
|
double positive_sentence_count = 0.0;
|
||||||
|
double positive_cap = 500.0;
|
||||||
List<String> concurrentRelations = new ArrayList();
|
List<String> concurrentRelations = new ArrayList();
|
||||||
List<Callable<SimilarityMatrix>> call_able_list = new ArrayList();
|
for (String str1 : values_copy) {
|
||||||
for (String str1 : strCache) {
|
|
||||||
if (!strF.equals(str1)) {
|
if (!strF.equals(str1)) {
|
||||||
|
if (positive_sentence_count > positive_cap) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
SentimentValueCache sentimentCacheStr1 = sentimentCachingMap.getOrDefault(str1, null);
|
SentimentValueCache sentimentCacheStr1 = sentimentCachingMap.getOrDefault(str1, null);
|
||||||
Callable<SimilarityMatrix> worker = new SentimentAnalyzerTest(strF, str1, new SimilarityMatrix(strF, str1),
|
Callable<SimilarityMatrix> worker = new SentimentAnalyzerTest(strF, str1, new SimilarityMatrix(strF, str1),
|
||||||
strAnnoJMWE, jmweAnnotationCache.get(str1), strAnno,
|
strAnnoJMWE, jmweAnnotationCache.get(str1), strAnno,
|
||||||
pipelineAnnotationCache.get(str1), strAnnoSentiment,
|
pipelineAnnotationCache.get(str1), strAnnoSentiment,
|
||||||
pipelineSentimentAnnotationCache.get(str1), coreDoc, coreDocumentAnnotationCache.get(str1), null, sentimentCacheStr1);
|
pipelineSentimentAnnotationCache.get(str1), coreDoc, coreDocumentAnnotationCache.get(str1), null, sentimentCacheStr1);
|
||||||
call_able_list.add(worker);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Callable<SimilarityMatrix> callSMX : call_able_list) {
|
|
||||||
try {
|
try {
|
||||||
SimilarityMatrix getSMX = callSMX.call();
|
SimilarityMatrix getSMX = worker.call();
|
||||||
if (getSMX != null) {
|
if (getSMX != null) {
|
||||||
Double scoreRelationLastUserMsg = getSMX.getDistance();
|
Double scoreRelationLastUserMsg = getSMX.getDistance();
|
||||||
if (scoreRelationLastUserMsg > preRelationUserCounters) {
|
if (scoreRelationLastUserMsg > preRelationUserCounters) {
|
||||||
preRelationUserCounters = scoreRelationLastUserMsg;
|
preRelationUserCounters = scoreRelationLastUserMsg;
|
||||||
concurrentRelations.add(getSMX.getSecondaryString());
|
concurrentRelations.add(getSMX.getSecondaryString());
|
||||||
|
positive_sentence_count += 0.1;
|
||||||
//System.out.println("secondary: " + getSMX.getSecondaryString() + "\nDistance: " + getSMX.getDistance() + "\n");
|
//System.out.println("secondary: " + getSMX.getSecondaryString() + "\nDistance: " + getSMX.getDistance() + "\n");
|
||||||
//System.out.println("SUCESS concurrentRelationsMap size: " + concurrentRelations.size() + "\n");
|
//System.out.println("SUCESS concurrentRelationsMap size: " + concurrentRelations.size() + "\n");
|
||||||
}
|
}
|
||||||
|
if (scoreRelationLastUserMsg > zero) {
|
||||||
|
positive_sentence_count += 155;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.getLogger(Datahandler.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(Datahandler.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder SB = new StringBuilder();
|
StringBuilder SB = new StringBuilder();
|
||||||
double randomLenghtPermit = strF.length() * (Math.random() * Math.random() * Math.random());
|
double randomLenghtPermit = strF.length() * ((Math.random() * Math.random() * Math.random()) * 100);
|
||||||
Collections.reverse(concurrentRelations);
|
Collections.reverse(concurrentRelations);
|
||||||
if (concurrentRelations.isEmpty()) {
|
if (concurrentRelations.isEmpty()) {
|
||||||
return "failure, preventing stuckness";
|
return "failure, preventing stuckness";
|
||||||
|
Loading…
Reference in New Issue
Block a user