class_docstr: Logger class for Comet integration
  
  `Comet <https://www.comet.ml/>`__ is a meta machine learning platform
  designed to help AI practitioners and teams build reliable machine learning
  models for real-world applications by streamlining the machine learning
  model lifecycle. By leveraging Comet, users can track, compare, explain and
  reproduce their machine learning experiments.
  
  To log a Spark NLP annotator, it will need an "outputLogPath" parameter, as the
  CometLogger reads the log file generated during the training process.
  
  For more examples see the `Examples
  <https://github.com/JohnSnowLabs/spark-nlp/blob/master/examples/python/logging/Comet_SparkNLP_Integration.ipynb>`__.
  
  Parameters
  ----------
  workspace : str, optional
      Name of the workspace in Comet, by default None
  project_name : str, optional
      Name of the project in Comet, by default None
  comet_mode : str, optional
      Mode of logging, by default None. If set to "offline" then offline mode
      will be used, otherwise online.
  experiment_id : str, optional
      Id of the experiment, if it is reused, by default None
  tags : List[str], optional
      List of tags for the experiment, by default None
  
  Attributes
  ----------
  experiment : comet_ml.Experiment
      Object representing the Comet experiment
  
  Raises
  ------
  ImportError
      If the package comet-ml is not installed
  
  Examples
  --------
  Metrics while training an annotator can be logged with for example:
  
  >>> import sparknlp
  >>> from sparknlp.base import *
  >>> from sparknlp.annotator import *
  >>> from sparknlp.logging.comet import CometLogger
  >>> spark = sparknlp.start()
  
  To run an online experiment, the logger is defined like so.
  
  >>> OUTPUT_LOG_PATH = "./run"
  >>> logger = CometLogger()
  
  Then the experiment can start like so
  
  >>> document = DocumentAssembler() \
  ...     .setInputCol("text")\
  ...     .setOutputCol("document")
  >>> embds = UniversalSentenceEncoder.pretrained() \
  ...     .setInputCols("document") \
  ...     .setOutputCol("sentence_embeddings")
  >>> multiClassifier = MultiClassifierDLApproach() \
  ...     .setInputCols("sentence_embeddings") \
  ...     .setOutputCol("category") \
  ...     .setLabelColumn("labels") \
  ...     .setBatchSize(128) \
  ...     .setLr(1e-3) \
  ...     .setThreshold(0.5) \
  ...     .setShufflePerEpoch(False) \
  ...     .setEnableOutputLogs(True) \
  ...     .setOutputLogsPath(OUTPUT_LOG_PATH) \
  ...     .setMaxEpochs(1)
  >>> logger.monitor(logdir=OUTPUT_LOG_PATH, model=multiClassifier)
  >>> trainDataset = spark.createDataFrame(
  ...     [("Nice.", ["positive"]), ("That's bad.", ["negative"])],
  ...     schema=["text", "labels"],
  ... )
  >>> pipeline = Pipeline(stages=[document, embds, multiClassifier])
  >>> pipeline.fit(trainDataset)
  >>> logger.end()
  
  If you are using a jupyter notebook, it is possible to display the live web
  interface with
  
  >>> logger.experiment.display(tab='charts')
class_docstr_tok: ["Logger","class","for","Comet","integration","`","Comet","<","https",":","\/\/www.comet.ml\/",">","`","__","is","a","meta","machine","learning","platform","designed","to","help","AI","practitioners","and","teams","build","reliable","machine","learning","models","for","real-world","applications","by","streamlining","the","machine","learning","model","lifecycle",".","By","leveraging","Comet",",","users","can","track",",","compare",",","explain","and","reproduce","their","machine","learning","experiments",".","To","log","a","Spark","NLP","annotator",",","it","will","need","an","``","outputLogPath","''","parameter",",","as","the","CometLogger","reads","the","log","file","generated","during","the","training","process",".","For","more","examples","see","the","`","Examples","<","https",":","\/\/github.com\/JohnSnowLabs\/spark-nlp\/blob\/master\/examples\/python\/logging\/Comet_SparkNLP_Integration.ipynb",">","`","__",".","Parameters","--","--","--","--","--","workspace",":","str",",","optional","Name","of","the","workspace","in","Comet",",","by","default","None","project_name",":","str",",","optional","Name","of","the","project","in","Comet",",","by","default","None","comet_mode",":","str",",","optional","Mode","of","logging",",","by","default","None",".","If","set","to","``","offline","''","then","offline","mode","will","be","used",",","otherwise","online",".","experiment_id",":","str",",","optional","Id","of","the","experiment",",","if","it","is","reused",",","by","default","None","tags",":","List","[","str","]",",","optional","List","of","tags","for","the","experiment",",","by","default","None","Attributes","--","--","--","--","--","experiment",":","comet_ml.Experiment","Object","representing","the","Comet","experiment","Raises","--","--","--","ImportError","If","the","package","comet-ml","is","not","installed","Examples","--","--","--","--","Metrics","while","training","an","annotator","can","be","logged","with","for","example",":",">",">",">","import","sparknlp",">",">",">","from","sparknlp.base","import","*",">",">",">","from","sparknlp.annotator","import","*",">",">",">","from","sparknlp.logging.comet","import","CometLogger",">",">",">","spark","=","sparknlp.start","(",")","To","run","an","online","experiment",",","the","logger","is","defined","like","so",".",">",">",">","OUTPUT_LOG_PATH","=","``",".\/run","''",">",">",">","logger","=","CometLogger","(",")","Then","the","experiment","can","start","like","so",">",">",">","document","=","DocumentAssembler","(",")","\\","...",".setInputCol","(","``","text","''",")","\\","...",".setOutputCol","(","``","document","''",")",">",">",">","embds","=","UniversalSentenceEncoder.pretrained","(",")","\\","...",".setInputCols","(","``","document","''",")","\\","...",".setOutputCol","(","``","sentence_embeddings","''",")",">",">",">","multiClassifier","=","MultiClassifierDLApproach","(",")","\\","...",".setInputCols","(","``","sentence_embeddings","''",")","\\","...",".setOutputCol","(","``","category","''",")","\\","...",".setLabelColumn","(","``","labels","''",")","\\","...",".setBatchSize","(","128",")","\\","...",".setLr","(","1e-3",")","\\","...",".setThreshold","(","0.5",")","\\","...",".setShufflePerEpoch","(","False",")","\\","...",".setEnableOutputLogs","(","True",")","\\","...",".setOutputLogsPath","(","OUTPUT_LOG_PATH",")","\\","...",".setMaxEpochs","(","1",")",">",">",">","logger.monitor","(","logdir=OUTPUT_LOG_PATH",",","model=multiClassifier",")",">",">",">","trainDataset","=","spark.createDataFrame","(","...","[","(","``","Nice",".","``",",","[","``","positive","''","]",")",",","(","``","That","'s","bad",".","``",",","[","``","negative","''","]",")","]",",","...","schema=","[","``","text","''",",","``","labels","''","]",",","...",")",">",">",">","pipeline","=","Pipeline","(","stages=","[","document",",","embds",",","multiClassifier","]",")",">",">",">","pipeline.fit","(","trainDataset",")",">",">",">","logger.end","(",")","If","you","are","using","a","jupyter","notebook",",","it","is","possible","to","display","the","live","web","interface","with",">",">",">","logger.experiment.display","(","tab='charts","'",")"]
docstr: Uploads a NER visualization from Spark NLP Display to comet.
  
  Parameters
  ----------
  html : str
      HTML of the spark NLP Display visualization
  name : str, optional
      Name for the visualization in comet, by default "viz.html"
  
  Examples
  --------
  This example has NER chunks (NER extracted by e.g. :class:`.NerDLModel`
  and converted by a :class:`.NerConverter`) extracted in the colum
  "ner_chunk".
  
  >>> from sparknlp_display import NerVisualizer
  >>> logger = CometLogger()
  >>> for idx, result in enumerate(results.collect()):
  ...     viz = NerVisualizer().display(
  ...         result=result,
  ...         label_col='ner_chunk',
  ...         document_col='document',
  ...         return_html=True
  ...     )
  ...     logger.log_visualization(viz, name=f'viz-{idx}.html')
docstr_tok: ["Uploads","a","NER","visualization","from","Spark","NLP","Display","to","comet",".","Parameters","--","--","--","--","--","html",":","str","HTML","of","the","spark","NLP","Display","visualization","name",":","str",",","optional","Name","for","the","visualization","in","comet",",","by","default","``","viz.html","''","Examples","--","--","--","--","This","example","has","NER","chunks","(","NER","extracted","by","e.g",".",":","class",":","`",".NerDLModel","`","and","converted","by","a",":","class",":","`",".NerConverter","`",")","extracted","in","the","colum","''","ner_chunk","''",".",">",">",">","from","sparknlp_display","import","NerVisualizer",">",">",">","logger","=","CometLogger","(",")",">",">",">","for","idx",",","result","in","enumerate","(","results.collect","(",")",")",":","...","viz","=","NerVisualizer","(",")",".display","(","...","result=result",",","...","label_col='ner_chunk","'",",","...","document_col='document","'",",","...","return_html=True","...",")","...","logger.log_visualization","(","viz",",","name=f'viz-","{","idx","}",".html","'",")"]
code: def log_visualization(self, html, name="viz.html"):
      """Uploads a NER visualization from Spark NLP Display to comet.
  
      Parameters
      ----------
      html : str
          HTML of the spark NLP Display visualization
      name : str, optional
          Name for the visualization in comet, by default "viz.html"
  
      Examples
      --------
      This example has NER chunks (NER extracted by e.g. :class:`.NerDLModel`
      and converted by a :class:`.NerConverter`) extracted in the colum
      "ner_chunk".
  
      >>> from sparknlp_display import NerVisualizer
      >>> logger = CometLogger()
      >>> for idx, result in enumerate(results.collect()):
      ...     viz = NerVisualizer().display(
      ...         result=result,
      ...         label_col='ner_chunk',
      ...         document_col='document',
      ...         return_html=True
      ...     )
      ...     logger.log_visualization(viz, name=f'viz-{idx}.html')
      """
      self.log_asset_data(html, name)
  
imports: import threading
  import time
  import os
label_desc: Use image node_id 4 for calling the CometLogger obj's underlying member method code with example usage: obj.log_visualization(html, name) without return types