Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
kermitt2 committed Jan 29, 2024
1 parent 268186d commit 23917c4
Showing 1 changed file with 3 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,9 @@ private static synchronized void getNewInstance() {
}

private LicenseClassifier() {
//ModelParameters parameterCopyrightsOwner = GrobidProperties.getModel("copyrights-owner");
//ModelParameters parameterLicenses = GrobidProperties.getModel("licenses");

//this.useBinary = configuration.getUseBinaryContextClassifiers();
if (this.useBinary == null)
this.useBinary = false;
//if (this.useBinary == null)
// this.useBinary = false;

this.classifierCopyrightsOwner = new DeLFTClassifierModel("copyright", GrobidProperties.getDelftArchitecture("copyright"));
this.classifierLicense = new DeLFTClassifierModel("license", GrobidProperties.getDelftArchitecture("license"));
Expand Down Expand Up @@ -140,49 +137,7 @@ public List<CopyrightsLicense> classify(List<String> texts) throws Exception {
bestProb = scoreUndecided;
}

/*JsonNode publisherNode = classificationsNodeCopyrights.findPath("publisher");
JsonNode authorsNode = classificationsNodeCopyrights.findPath("authors");
JsonNode undecideNode = classificationsNodeCopyrights.findPath("undecided");
JsonNode textNode = classificationsNodeCopyrights.findPath("text");
double scorePublisher = 0.0;
if ((publisherNode != null) && (!publisherNode.isMissingNode())) {
scorePublisher = publisherNode.doubleValue();
}
double scoreAuthors = 0.0;
if ((authorsNode != null) && (!authorsNode.isMissingNode())) {
scoreAuthors = authorsNode.doubleValue();
}
double scoreUndecided = 0.0;
if ((undecideNode != null) && (!undecideNode.isMissingNode())) {
scoreUndecided = undecideNode.doubleValue();
}
String textValue = null;
if ((textNode != null) && (!textNode.isMissingNode())) {
textValue = textNode.textValue();
}
CopyrightsOwner owner = null;
double bestProb = 0.0;
if (scorePublisher>0.5) {
owner = CopyrightsOwner.PUBLISHER;
bestProb = scorePublisher;
}
if (scoreAuthors > 0.5 && scoreAuthors >= scorePublisher) {
owner = CopyrightsOwner.AUTHORS;
bestProb = scoreAuthors;
}
if (scoreUndecided > bestProb) {
owner = CopyrightsOwner.UNDECIDED;
bestProb = scoreUndecided;
}*/

// ser best copyright owner with prob
// set best copyright owner with prob
result.setCopyrightsOwner(owner);
result.setCopyrightsOwnerProb(bestProb);

Expand Down

0 comments on commit 23917c4

Please sign in to comment.