You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2021/12/05 18:23:47 UTC

[incubator-streampipes] branch dev updated: [hotfix] Remove obsolete files

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 95103fb  [hotfix] Remove obsolete files
95103fb is described below

commit 95103fbb9e4e3fb8d7f719b6bd16e8e5e585df75
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Sun Dec 5 19:23:36 2021 +0100

    [hotfix] Remove obsolete files
---
 .../flink/processor/entity/EntityExtraction.java   |  60 ---------------------
 .../processor/entity/EntityExtractionModel.java    |  42 ---------------
 .../src/main/resources/en-ner-location.bin         | Bin 5110658 -> 0 bytes
 .../src/main/resources/en-ner-organization.bin     | Bin 5297172 -> 0 bytes
 .../src/main/resources/en-ner-person.bin           | Bin 5207953 -> 0 bytes
 5 files changed, 102 deletions(-)

diff --git a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/java/org/apache/streampipes/processors/textmining/flink/processor/entity/EntityExtraction.java b/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/java/org/apache/streampipes/processors/textmining/flink/processor/entity/EntityExtraction.java
deleted file mode 100644
index e038163..0000000
--- a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/java/org/apache/streampipes/processors/textmining/flink/processor/entity/EntityExtraction.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.streampipes.processors.textmining.flink.processor.entity;
-
-import opennlp.tools.namefind.NameFinderME;
-import opennlp.tools.namefind.TokenNameFinderModel;
-import opennlp.tools.util.Span;
-import org.apache.flink.api.common.functions.FlatMapFunction;
-import org.apache.flink.util.Collector;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-
-public class EntityExtraction implements FlatMapFunction<Map<String, Object>, Map<String, Object>> {
-
-  private String fieldName;
-  private EntityExtractionModel entityExtractionModel;
-  NameFinderME nameFinder;
-
-  public EntityExtraction(String fieldName, EntityExtractionModel entityExtractionModel) throws IOException {
-    this.fieldName = fieldName;
-    this.entityExtractionModel = entityExtractionModel;
-    this.loadModel();
-  }
-
-  private void loadModel() throws IOException {
-    try (InputStream modelIn = new FileInputStream(entityExtractionModel.getFilename())){
-      TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
-      this.nameFinder = new NameFinderME(model);
-    }
-  }
-
-  @Override
-  public void flatMap(Map<String, Object> in, Collector<Map<String, Object>> out) throws Exception {
-    String value = String.valueOf(in.get(fieldName));
-    Span[] entities = nameFinder.find(new String[] {value});
-
-    // TODO
-
-    out.collect(in);
-
-  }
-}
diff --git a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/java/org/apache/streampipes/processors/textmining/flink/processor/entity/EntityExtractionModel.java b/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/java/org/apache/streampipes/processors/textmining/flink/processor/entity/EntityExtractionModel.java
deleted file mode 100644
index cfe744a..0000000
--- a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/java/org/apache/streampipes/processors/textmining/flink/processor/entity/EntityExtractionModel.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.processors.textmining.flink.processor.entity;
-
-public enum EntityExtractionModel {
-
-  PERSON("Person", "en-ner-location.bin"),
-  ORGANIZATION("Organization", "en-ner-organization.bin"),
-  LOCATION("Location", "en-ner-location.bin");
-
-  private String modelName;
-  private String filename;
-
-  EntityExtractionModel(String modelName, String filename) {
-    this.modelName = modelName;
-    this.filename = filename;
-  }
-
-  public String getModelName() {
-    return modelName;
-  }
-
-  public String getFilename() {
-    return filename;
-  }
-}
diff --git a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/resources/en-ner-location.bin b/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/resources/en-ner-location.bin
deleted file mode 100644
index f3788bc..0000000
Binary files a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/resources/en-ner-location.bin and /dev/null differ
diff --git a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/resources/en-ner-organization.bin b/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/resources/en-ner-organization.bin
deleted file mode 100644
index 1fb6d9f..0000000
Binary files a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/resources/en-ner-organization.bin and /dev/null differ
diff --git a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/resources/en-ner-person.bin b/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/resources/en-ner-person.bin
deleted file mode 100644
index 2f68318..0000000
Binary files a/streampipes-extensions/streampipes-processors-text-mining-flink/src/main/resources/en-ner-person.bin and /dev/null differ