Examples of TrainingSetException


Examples of org.apache.stanbol.enhancer.topic.api.training.TrainingSetException

                solrServer.commit();
                return exampleId;
            } catch (Exception e) {
                String msg = String.format("Error deleting example with id '%s' on Solr Core '%s'",
                    exampleId, solrCoreId);
                throw new TrainingSetException(msg, e);
            }
        }

        if (exampleId == null || exampleId.isEmpty()) {
            exampleId = UUID.randomUUID().toString();
        }
        SolrInputDocument doc = new SolrInputDocument();
        doc.addField(exampleIdField, exampleId);
        doc.addField(exampleTextField, text);
        if (topics != null) {
            doc.addField(topicUrisField, topics);
        }
        doc.addField(modificationDateField, UTCTimeStamper.nowUtcDate());
        SolrServer server = getActiveSolrServer();
        try {
            server.add(doc);
            server.commit();
        } catch (Exception e) {
            String msg = String.format("Could not register example '%s' with topics: ['%s']", exampleId,
                StringUtils.join(topics, "', '"));
            throw new TrainingSetException(msg, e);
        }
        return exampleId;
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.topic.api.training.TrainingSetException

            return solrServer.query(query).getResults().size() > 0;
        } catch (SolrServerException e) {
            String msg = String.format(
                "Error while fetching topics for examples modified after '%s' on Solr Core '%s'.",
                utcIsoDate, solrCoreId);
            throw new TrainingSetException(msg, e);
        }
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.topic.api.training.TrainingSetException

            }
        } catch (SolrServerException e) {
            String msg = String.format(
                "Error while fetching positive examples for topics ['%s'] on Solr Core '%s'.",
                StringUtils.join(topics, "', '"), solrCoreId);
            throw new TrainingSetException(msg, e);
        }
        return new Batch<Example>(items, nextExampleId != null, nextExampleId);
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.topic.api.training.TrainingSetException

    @Override
    public void optimize() throws TrainingSetException {
        try {
            getActiveSolrServer().optimize();
        } catch (Exception e) {
            throw new TrainingSetException("Error optimizing training dataset " + getName(), e);
        }
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.topic.api.training.TrainingSetException

                }
            }
            solrServer.optimize();
        } catch (Exception e) {
            String msg = String.format("Error while updating topics on Solr Core '%s'.", solrCoreId);
            throw new TrainingSetException(msg, e);
        }
        return processedCount;
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.topic.api.training.TrainingSetException

        log.debug("Sucessfully updated topic {} in {}s", conceptUri, (double) (stop - start) / 1000.);
    }

    protected void checkTrainingSet() throws TrainingSetException {
        if (getTrainingSet() == null) {
            throw new TrainingSetException(String.format("TopicClassificationEngine %s has no registered"
                                                         + " training set hence cannot be updated.",
                engineName));
        }
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.topic.training.TrainingSetException

                }
            }
            solrServer.optimize();
        } catch (Exception e) {
            String msg = String.format("Error while updating topics on Solr Core '%s'.", solrCoreId);
            throw new TrainingSetException(msg, e);
        }
        return processedCount;
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.topic.training.TrainingSetException

        log.debug("Sucessfully updated topic {} in {}s", conceptUri, (double) (stop - start) / 1000.);
    }

    protected void checkTrainingSet() throws TrainingSetException {
        if (getTrainingSet() == null) {
            throw new TrainingSetException(String.format("TopicClassificationEngine %s has no registered"
                                                         + " training set hence cannot be updated.",
                engineName));
        }
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.topic.training.TrainingSetException

                }
            }
            solrServer.optimize();
        } catch (Exception e) {
            String msg = String.format("Error while updating topics on Solr Core '%s'.", solrCoreId);
            throw new TrainingSetException(msg, e);
        }
        return processedCount;
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.topic.training.TrainingSetException

        log.debug("Sucessfully updated topic {} in {}s", conceptUri, (double) (stop - start) / 1000.);
    }

    protected void checkTrainingSet() throws TrainingSetException {
        if (trainingSet == null) {
            throw new TrainingSetException(
                    String.format("TopicClassificationEngine %s has no registered"
                                  + " training set hence cannot be updated.", engineId));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.