class_docstr: This is an implementation of the smoothing techniques
  for segment-level BLEU scores that was presented in
  Boxing Chen and Collin Cherry (2014) A Systematic Comparison of
  Smoothing Techniques for Sentence-Level BLEU. In WMT14.
  http://acl2014.org/acl2014/W14-33/pdf/W14-3346.pdf
class_docstr_tok: ["This","is","an","implementation","of","the","smoothing","techniques","for","segment-level","BLEU","scores","that","was","presented","in","Boxing","Chen","and","Collin","Cherry","(","2014",")","A","Systematic","Comparison","of","Smoothing","Techniques","for","Sentence-Level","BLEU",".","In","WMT14",".","http",":","\/\/acl2014.org\/acl2014\/W14-33\/pdf\/W14-3346.pdf"]
docstr: Smoothing method 3: NIST geometric sequence smoothing
  The smoothing is computed by taking 1 / ( 2^k ), instead of 0, for each
  precision score whose matching n-gram count is null.
  k is 1 for the first 'n' value for which the n-gram match count is null/
  
  For example, if the text contains:
  
  - one 2-gram match
  - and (consequently) two 1-gram matches
  
  the n-gram count for each individual precision score would be:
  
  - n=1  =>  prec_count = 2     (two unigrams)
  - n=2  =>  prec_count = 1     (one bigram)
  - n=3  =>  prec_count = 1/2   (no trigram,  taking 'smoothed' value of 1 / ( 2^k ), with k=1)
  - n=4  =>  prec_count = 1/4   (no fourgram, taking 'smoothed' value of 1 / ( 2^k ), with k=2)
docstr_tok: ["Smoothing","method","3",":","NIST","geometric","sequence","smoothing","The","smoothing","is","computed","by","taking","1","\/","(","2^k",")",",","instead","of","0",",","for","each","precision","score","whose","matching","n-gram","count","is","null",".","k","is","1","for","the","first","'n","'","value","for","which","the","n-gram","match","count","is","null\/","For","example",",","if","the","text","contains",":","-","one","2-gram","match","-","and","(","consequently",")","two","1-gram","matches","the","n-gram","count","for","each","individual","precision","score","would","be",":","-","n=1","=",">","prec_count","=","2","(","two","unigrams",")","-","n=2","=",">","prec_count","=","1","(","one","bigram",")","-","n=3","=",">","prec_count","=","1\/2","(","no","trigram",",","taking","'smoothed","'","value","of","1","\/","(","2^k",")",",","with","k=1",")","-","n=4","=",">","prec_count","=","1\/4","(","no","fourgram",",","taking","'smoothed","'","value","of","1","\/","(","2^k",")",",","with","k=2",")"]
code: def method3(self, p_n, *args, **kwargs):
      """
      Smoothing method 3: NIST geometric sequence smoothing
      The smoothing is computed by taking 1 / ( 2^k ), instead of 0, for each
      precision score whose matching n-gram count is null.
      k is 1 for the first 'n' value for which the n-gram match count is null/
  
      For example, if the text contains:
  
      - one 2-gram match
      - and (consequently) two 1-gram matches
  
      the n-gram count for each individual precision score would be:
  
      - n=1  =>  prec_count = 2     (two unigrams)
      - n=2  =>  prec_count = 1     (one bigram)
      - n=3  =>  prec_count = 1/2   (no trigram,  taking 'smoothed' value of 1 / ( 2^k ), with k=1)
      - n=4  =>  prec_count = 1/4   (no fourgram, taking 'smoothed' value of 1 / ( 2^k ), with k=2)
      """
      incvnt = 1  # From the mteval-v13a.pl, it's referred to as k.
      for i, p_i in enumerate(p_n):
          if p_i.numerator == 0:
              p_n[i] = 1 / (2**incvnt * p_i.denominator)
              incvnt += 1
      return p_n
  
imports: import math
  import sys
  import warnings
  from collections import Counter
  from fractions import Fraction
  from nltk.util import ngrams
label_desc: Use image node_id 5 for calling the SmoothingFunction obj's underlying member method code with example usage: obj.method3(p_n) and returns: p_n