code: def parse_megam_weights(s, features_count, explicit=True):
      """
      Given the stdout output generated by ``megam`` when training a
      model, return a ``numpy`` array containing the corresponding weight
      vector.  This function does not currently handle bias features.
      """
      if numpy is None:
          raise ValueError(
              "This function requires that numpy be installed"
          )
      assert explicit, "non-explicit not supported yet"
      lines = s.strip().split("\n")
      weights = numpy.zeros(features_count, "d")
      for line in lines:
          if line.strip():
              fid, weight = line.split()
              weights[int(fid)] = float(weight)
      return weights
  
imports: import subprocess
  from nltk.internals import find_binary
label_desc: Use image node_id 3 for calling a global function with example usage: parse_megam_weights(s, features_count, explicit) and returns: weights