Class ModelSmokeTestReport

java.lang.Object
com.lexalytics.salience.ModelSmokeTestReport

public class ModelSmokeTestReport
extends java.lang.Object

A model smoke test report is a report about documents run against machine-learning models in a Salience configuration directory. It always contains one of a few well-known error messages, along with additional, contextual information that will help someone to troubleshoot any problems with models and is meant to be self-explanatory.

A model smoke test is run by calling Salience.getDocumentTopics(), which returns a vector of messages about successful smoke tests and a vector of vector of error messages.

  • Constructor Summary

    Constructors 
    Constructor Description
    ModelSmokeTestReport​(java.lang.String sModelPath, java.lang.String sMessage, java.lang.String sExplanation, java.lang.String sDocumentId, java.lang.String sExpectedLabel, java.lang.String sActualLabel, java.lang.String sExpectedSpanOffset, java.lang.String sActualSpanOffset, java.lang.String sExpectedSpanLength, java.lang.String sActualSpanLength)
    Creates a new model smoke test report.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getActualLabel()
    Returns classification label of document or span found by model in tested document.
    java.lang.String getActualSpanLength()
    Returns length of mention (in characters) found by model in the document being tested.
    java.lang.String getActualSpanOffset()
    Returns character offset of mention found by model within the document being tested.
    java.lang.String getDocumentId()
    Returns ID of document on which test was run.
    java.lang.String getExpectedLabel()
    Returns expected classification label of tested document or span in tested document.
    java.lang.String getExpectedSpanLength()
    Returns expected length of mention (in characters) in the document being tested.
    java.lang.String getExpectedSpanOffset()
    Returns expected character offset of a mention within the document being tested.
    java.lang.String getExplanation()
    Returns contextual information about the test outcome.
    java.lang.String getMessage()
    Returns a well-known message for the type of test outcome.
    java.lang.String getModelPath()
    Returns the absolute file path to the model being test.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ModelSmokeTestReport

      public ModelSmokeTestReport​(java.lang.String sModelPath, java.lang.String sMessage, java.lang.String sExplanation, java.lang.String sDocumentId, java.lang.String sExpectedLabel, java.lang.String sActualLabel, java.lang.String sExpectedSpanOffset, java.lang.String sActualSpanOffset, java.lang.String sExpectedSpanLength, java.lang.String sActualSpanLength)
      Creates a new model smoke test report. This is not intended for client use. A ModelSmokeTestResult is created by Salience Engine when a smoke test is run.
      Parameters:
      sModelPath - Absolute path name of the model file being tested
      sMessage - A well-known message describing the type of test outcome
      sExplanation - Additional, contextual information about the test outcome
      sDocumentId - ID of document on which test was run
      sExpectedLabel - Expected classification label of tested document or span in tested document
      sActualLabel - Classification label of document or span found by model in tested document
      sExpectedSpanOffset - Expected character offset of a mention within the document being tested
      sActualSpanOffset - Character offset of mention found by model within the document being tested
      sExpectedSpanLength - Expected length of mention (in characters) in the document being tested
      sActualSpanLength - Length of mention (in characters) found by model in the document being tested
  • Method Details

    • getMessage

      public java.lang.String getMessage()
      Returns a well-known message for the type of test outcome. This will never be blank.
      Returns:
      A String containing the message.
    • getModelPath

      public java.lang.String getModelPath()
      Returns the absolute file path to the model being test. This could be blank if not relevant to the type of test outcome.
      Returns:
      A String containing the file path.
    • getExplanation

      public java.lang.String getExplanation()
      Returns contextual information about the test outcome. This could be blank if not relevant to the type of test outcome.
      Returns:
      A String containing the explantion.
    • getDocumentId

      public java.lang.String getDocumentId()
      Returns ID of document on which test was run. This could be blank if not relevant to the type of test outcome.
      Returns:
      A String containing the document.
    • getExpectedLabel

      public java.lang.String getExpectedLabel()
      Returns expected classification label of tested document or span in tested document. This could be blank if not relevant to the type of test outcome.
      Returns:
      A String containing the label.
    • getActualLabel

      public java.lang.String getActualLabel()
      Returns classification label of document or span found by model in tested document. This could be blank if not relevant to the type of test outcome.
      Returns:
      A String containing the label.
    • getExpectedSpanOffset

      public java.lang.String getExpectedSpanOffset()
      Returns expected character offset of a mention within the document being tested. This could be blank if not relevant to the type of test outcome.
      Returns:
      A String containing the offset.
    • getActualSpanOffset

      public java.lang.String getActualSpanOffset()
      Returns character offset of mention found by model within the document being tested. This could be blank if not relevant to the type of test outcome.
      Returns:
      A String containing the offset.
    • getExpectedSpanLength

      public java.lang.String getExpectedSpanLength()
      Returns expected length of mention (in characters) in the document being tested. This could be blank if not relevant to the type of test outcome.
      Returns:
      A String containing the length.
    • getActualSpanLength

      public java.lang.String getActualSpanLength()
      Returns length of mention (in characters) found by model in the document being tested. This could be blank if not relevant to the type of test outcome.
      Returns:
      A String containing the length.