public class SpacyClassifierModelCreator extends Object
Constructor and Description |
---|
SpacyClassifierModelCreator()
Construct a SpacyClassifierModelCreator.
|
Modifier and Type | Method and Description |
---|---|
static SpacyClassifierModelCreator |
construct(AttributeValueTable trainingProps)
Construct an instance of SpacyClassifierModelCreator for
the specified training properties.
|
static SpacyClassifierModelCreator |
construct(String className)
Construct an instance of SpacyClassifierModelCreator for
the specified class name.
|
void |
copyOutputFile(String tempDir,
String outputFileName)
Copy the output file.
|
void |
copyTempFile(String tempFilePath)
Copy a temp file prior to executing a parse.
|
Document |
create(InformationExtractionTrainingSet tset,
InformationExtractionParserSpecification pspec,
AttributeValueTable trainingProps,
String docName,
String docDesc,
AccessControlList docAcl,
Folder docFolder)
Create a new Spacy Classifier model, stored as a Document,
based on the specified training set.
|
protected Document |
getDocument(AttributeValue av,
LibrarySession session)
Gets a Document object from the specified AttributeValue,
which can reference a Document, Family, or VersionSeries.
|
List<String> |
getPythonCommandList(String pythonFile,
String inputFile)
Gets the list of arguments to launch the Python process.
|
protected String |
getPythonTrainingScriptContent()
Gets (or derives) the python script to execute for training.
|
String |
normalizeTempFilePath(String tempDir,
String filePath)
Normalize (modify) the temp file path specified.
|
void |
preCreate()
Perform task prior to executing the create.
|
public SpacyClassifierModelCreator()
public static SpacyClassifierModelCreator construct(AttributeValueTable trainingProps) throws IfsException
trainingProps
- the training propertiesIfsException
- if the operation failspublic static SpacyClassifierModelCreator construct(String className) throws IfsException
className
- the class name; if null, construct a default instanceIfsException
- if the operation failspublic Document create(InformationExtractionTrainingSet tset, InformationExtractionParserSpecification pspec, AttributeValueTable trainingProps, String docName, String docDesc, AccessControlList docAcl, Folder docFolder) throws IfsException
tset
- the training setpspec
- the ParserSpecification to apply updated modeltrainingProps
- the Spacy training property overridesdocName
- the name to use for the new training documentdocDesc
- the description to use for the new training documentdocAcl
- the ACL to use for the new training documentdocFolder
- the Parent folder for the new training documentIfsException
- if the operation failsprotected String getPythonTrainingScriptContent()
public void preCreate() throws IfsException
Override to pick up settings.
IfsException
- if the operation failspublic String normalizeTempFilePath(String tempDir, String filePath) throws IfsException
tempDir
- the absolute path to the temp file directory,
which is typically the prefix of the filePathfilePath
- the absolute path to the temp fileIfsException
- if the operation failspublic void copyTempFile(String tempFilePath) throws IfsException
tempFilePath
- the absolute path to the temp fileIfsException
- if the operation failspublic void copyOutputFile(String tempDir, String outputFileName) throws IfsException
tempDir
- the absolute path to the temp file directoryoutputFileName
- the name of the output fileIfsException
- if the operation failspublic List<String> getPythonCommandList(String pythonFile, String inputFile)
pythonFile
- the Python fileinputFile
- the input fileprotected Document getDocument(AttributeValue av, LibrarySession session) throws IfsException
IfsException
- if the operation failsCopyright © 2023. All rights reserved.