class_docstr: Corpus in SVMlight format.
  
  Quoting http://svmlight.joachims.org/:
  The input file contains the training examples. The first lines  may contain comments and are ignored
  if they start with #. Each of the following lines represents one training example
  and is of the following format::
  
      <line> .=. <target> <feature>:<value> <feature>:<value> ... <feature>:<value> # <info>
      <target> .=. +1 | -1 | 0 | <float>
      <feature> .=. <integer> | "qid"
      <value> .=. <float>
      <info> .=. <string>
  
  The "qid" feature (used for SVMlight ranking), if present, is ignored.
  
  Notes
  -----
  Although not mentioned in the specification above, SVMlight also expect its feature ids to be 1-based
  (counting starts at 1). We convert features to 0-base internally by decrementing all ids when loading a SVMlight
  input file, and increment them again when saving as SVMlight.
class_docstr_tok: ["Corpus","in","SVMlight","format",".","Quoting","http",":","\/\/svmlight.joachims.org\/",":","The","input","file","contains","the","training","examples",".","The","first","lines","may","contain","comments","and","are","ignored","if","they","start","with","#",".","Each","of","the","following","lines","represents","one","training","example","and","is","of","the","following","format",":",":","<","line",">",".=",".","<","target",">","<","feature",">",":","<","value",">","<","feature",">",":","<","value",">","...","<","feature",">",":","<","value",">","#","<","info",">","<","target",">",".=",".","+1","|","-1","|","0","|","<","float",">","<","feature",">",".=",".","<","integer",">","|","``","qid","''","<","value",">",".=",".","<","float",">","<","info",">",".=",".","<","string",">","The","``","qid","''","feature","(","used","for","SVMlight","ranking",")",",","if","present",",","is","ignored",".","Notes","--","--","-","Although","not","mentioned","in","the","specification","above",",","SVMlight","also","expect","its","feature","ids","to","be","1-based","(","counting","starts","at","1",")",".","We","convert","features","to","0-base","internally","by","decrementing","all","ids","when","loading","a","SVMlight","input","file",",","and","increment","them","again","when","saving","as","SVMlight","."]
docstr: Convert BoW representation of document in SVMlight format.
  This method inverse of :meth:`~gensim.corpora.svmlightcorpus.SvmLightCorpus.line2doc`.
  
  Parameters
  ----------
  doc : list of (int, float)
      Document in BoW format.
  label : int, optional
      Document label (if provided).
  
  Returns
  -------
  str
      `doc` in SVMlight format.
docstr_tok: ["Convert","BoW","representation","of","document","in","SVMlight","format",".","This","method","inverse","of",":","meth",":","`","~gensim.corpora.svmlightcorpus.SvmLightCorpus.line2doc","`",".","Parameters","--","--","--","--","--","doc",":","list","of","(","int",",","float",")","Document","in","BoW","format",".","label",":","int",",","optional","Document","label","(","if","provided",")",".","Returns","--","--","--","-","str","`","doc","`","in","SVMlight","format","."]
code: def doc2line(doc, label=0):
      """Convert BoW representation of document in SVMlight format.
      This method inverse of :meth:`~gensim.corpora.svmlightcorpus.SvmLightCorpus.line2doc`.
  
      Parameters
      ----------
      doc : list of (int, float)
          Document in BoW format.
      label : int, optional
          Document label (if provided).
  
      Returns
      -------
      str
          `doc` in SVMlight format.
  
      """
      pairs = " ".join(
          "%i:%s" % (termid + 1, termval) for termid, termval in doc
      )  # +1 to convert 0-base to 1-base
      return "%s %s\n" % (label, pairs)
  
file_path: gensim/gensim/corpora/svmlightcorpus.py
imports: from __future__ import with_statement
  import logging
  from gensim import utils
  from gensim.corpora import IndexedCorpus
label_desc: Use image node_id 6 for calling the SvmLightCorpus obj's underlying member method code with example usage: obj.doc2line(doc, label) and returns: unknown