-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# entity_extracter/__init__.py - demo agent service adapter... | ||
# | ||
# Copyright (c) 2017 SingularityNET | ||
# | ||
# Distributed under the MIT software license, see LICENSE file. | ||
# | ||
|
||
from typing import List | ||
|
||
from sn_agent.job.job_descriptor import JobDescriptor | ||
from sn_agent.service_adapter.base import ModuleServiceAdapterABC | ||
|
||
import logging | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
class EntityExtracter(ModuleServiceAdapterABC): | ||
type_name = "EntityExtracter" | ||
|
||
def __init__(self, app, service_ontology_node, required_service_nodes, name: str): | ||
super().__init__(app, service_ontology_node, required_service_nodes, name) | ||
|
||
def perform(self, job: JobDescriptor): | ||
item_count = 0 | ||
for job_item in job: | ||
file_name = job[item_count]['output_url'] | ||
with open(file_name, 'w') as file: | ||
file.write("entity:\n") | ||
file.write(" pig\n") | ||
file.write(" farmer\n") | ||
file.write(" tractor\n") | ||
file.write(" cornfield\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters