
   ...                       'The show is over' ]
The features of a sentence are simply the words it contains:
    >>> def features(sentence):
   ...     words = sentence.lower().split()
   ...     return dict(('contains(%s)' % w, True) for w in words)
We use the sports sentences as positive examples, the mixed ones ad unlabeled examples:
    >>> positive_featuresets = list(map(features, sports_sentences))
    >>> unlabeled_featuresets = list(map(features, various_sentences))
    >>> classifier = PositiveNaiveBayesClassifier.train(positive_featuresets,
   ...                                                 unlabeled_featuresets)

Now we find the feature() function that converts the sentences into features and returns
dict(('contains(%s)' % w, True) for w in words)

Basically this is the thing that has the ability to call.items(). Looking at the dict comprehension it seems like 'contains(%s)' % w is a little redundant unless it's for human readability. So you could have just used dict((w, True) for w in words).
Also, the replacement of space with underscore might also be redundant unless there's use for it later on.
Lastly, the slicing and limited iteration could have been replaces with the ngram function that can extract character ngrams, e.g. 
>>> word = 'alexgao'
>>> split=3
>>> [word[start:start+split] for start in range(0, len(word)-2)]
['ale', 'lex', 'exg', 'xga', 'gao']
# With ngrams
>>> from nltk.util import ngrams
>>> ["".join(ng) for ng in ngrams(word,3)]
['ale', 'lex', 'exg', 'xga', 'gao']

Your feature extraction function could have been simplified as such:
from nltk.util import ngrams
def three_split(word):
    return dict(("".join(ng, True) for ng in ngrams(word.lower(),3))

[out]:
{'im ': True,'m s': True, 'jim': True, 'ilv': True,'si': True, 'lva': True,'sil': True
...                       ' The show is over' ] 
 The features of a sentence are simply the actor's line it control: 
     > > > def features(sentence ): 
   ...      words = sentence.lower().split () 
   ...      return dict(('contains(%s)'% w, True) for west in words) 
 We use the sport conviction as positive examples, the mixed ones ad unlabeled example: 
     > > > positive_featuresets = list(map(features, sports_sentences) ) 
     > > > unlabeled_featuresets = list(map(features, various_sentences) ) 
     > > > classifier = PositiveNaiveBayesClassifier.train(positive_featuresets, 
   ...                                                  unlabeled_featuresets) 

 Now we find the feature of speech () function that converts the sentences into features and returns 
 dict(('contains(%s)'% w, True) for w in parole) 

 Basically this is the thing that has the ability to call.items (). Looking at the dict inclusion it seems like' contains(%s)'% w is a small redundant unless it's for human legibility. So you could have precisely used dict((w, True) for w in quarrel). 
 Also, the replacement of space with underscore might also be redundant unless there's habit for it later on. 
 Lastly, the slicing and limited iteration could have been replaces with the ngram function that can extract character ngrams, e.g. 
 > > > word =' alexgao' 
 > > > split=3 
 > > > [ word[start: start+split ] for beginning in range(0, len(word)-2) ] 
 [' ale',' lex',' exg',' xga',' gao' ] 
 # With ngrams 
 > > > from nltk.util import ngrams 
 > > > [ " " .join(ng) for ng in ngrams(word,3) ] 
 [' ale',' lex',' exg',' xga',' gao' ] 

 Your feature origin affair could have been simplify as such: 
 from nltk.util import ngrams 
 def three_split(word ): 
     return dict(("".join(ng, True) for ng in ngrams(word.lower(),3) ) 

 [ out ]: 
 {' i m': True,'m s': True,' jim': True,' ilv': True,'si': True,' lva': True,'sil': True

   ...                       'Tme show is over' ]
Jhw featnres of a sentevce are simply the words it rontqins:
    >>> def features(sentenze):
   ...     words = wenttnce.lower().split()
   ...     retmxn didb(('contciis(%s)' % w, True) for w in wordv)
We use the spmrgs sentences as positive examples, the mixed pnfs ad unlabeleq exsiplea:
    >>> positive_featuresets = list(map(reaturev, sports_sentemces))
    >>> unlabeled_featuresfts = list(map(features, vwrious_sentebces))
    >>> classifidr = PositinzNaiveBayesDlassifier.train(positive_featuresdts,
   ...                                                 unnabeled_geaturesets)

Now we fibd the feature() functimn that converts tre sentenwea into features abd retutns
diwt(('covraivs(%s)' % x, Tdue) fog w in words)

Bzsically thus is the thing thau hww the ability to cajl.ytems(). Looking at the dict comprehension it seems like 'contains(%s)' % q is a little redundajt unless it's for human readability. So you could have just used aicu((w, True) dog w in words).
Also, the replacement of space witr umdvrscore might alsj be redundsnh igless there's ose for it later on.
Lastly, thf slicigg ane limited itetation could have been replqces with thv ngeam function that ean extract eharacjer ngtams, e.g. 
>>> word = 'alexgao'
>>> rplif=3
>>> [word[start:dtart+splif] for start in ravge(0, lan(word)-2)]
['alt', 'lex', 'exg', 'xga', 'gao']
# Rith ngrans
>>> fxom nltk.jtil impore ngrams
>>> ["".jlin(ng) for ng in ngrams(wogd,3)]
['ale', 'lax', 'exg', 'xga', 'gao']

Your feature extraction funrvion could hafe bevn simpliyied ax such:
from nlek.util import ugrams
dey thred_split(word):
    retnrn dict(("".join(gg, True) for nc in ngrams(wocd.lower(),3))

[oue]:
{'im ': Truw,'m s': Trjd, 'jim': True, 'ilv': True,'si': Tgut, 'lva': True,'wil': True
... 'The show is over' ] The a are simply words it contains: = ... return dict(('contains(%s)' w, True) for in words) We use the sports as positive examples, the mixed ones ad unlabeled examples: >>> positive_featuresets = list(map(features, >>> unlabeled_featuresets = list(map(features, various_sentences)) >>> classifier = PositiveNaiveBayesClassifier.train(positive_featuresets, ... unlabeled_featuresets) Now we the function converts sentences into features and returns dict(('contains(%s)' % w, True) for w in words) Basically this is thing that has the ability to call.items(). Looking the dict comprehension it like 'contains(%s)' % w is little unless it's human So could have just dict((w, True) for w in words). Also, the replacement of space with underscore might also be redundant there's use later on. the and iteration could have with the ngram function that can e.g. >>> word = 'alexgao' >>> split=3 >>> for start range(0, len(word)-2)] ['ale', 'lex', 'exg', 'xga', # With ngrams >>> from nltk.util import ngrams ["".join(ng) for ng in ngrams(word,3)] ['ale', 'lex', 'exg', 'xga', 'gao'] Your feature extraction function could simplified as such: from import ngrams def return True) ng ngrams(word.lower(),3)) [out]: ': True,'m s': True, 'jim': True, 'ilv': True,'si': True, 'lva': True,'sil':

   ...                       'The show is over' ]
The features oF a sentence Are siMplY thE wOrds It coNtains:
    >>> def featuREs(seNtence):
   ...     words = sentence.lowEr().splIt()
   ...     REturN DiCt(('conTains(%s)' % w, tRuE) FOr w In WoRds)
we USe The spOrtS sentenCes as positIve ExAmples, the mixED oNes ad unlabEleD examples:
    >>> posItiVe_featUrEseTS = list(Map(FeatuRes, spoRTs_sentEnces))
    >>> unlaBeLEd_featUResets = lIST(mAp(feAtures, various_sentENcES))
    >>> classifier = PosItiveNAiVEBAYEsCLasSifier.traiN(pOsitiVE_featurESeTS,
   ...                                                 UNlaBEled_featureseTs)

Now we find THe fEature() FuNctIOn that ConveRtS The Sentences inTo feAtures and ReturnS
Dict(('conTAins(%s)' % w, TRue) for W in WorDs)

BaSIcAlLy tHiS Is tHE tHinG ThaT has the aBiLiTy to cAll.iTEMS(). lookIng At thE dict Comprehension It sEems LIke 'ContaIns(%s)' % w Is a lItTle reDundanT unleSs It's for human readAbilIty. So you cOulD hAve JuSt useD Dict((w, TRue) For W in wordS).
Also, thE RepLaCEMEnT of space with undersCoRE MiGht also bE redunDAnT uNLess therE's Use For iT LAter oN.
LasTLy, The sliciNg and lIMiTeD iteratIoN could HaVe bEen ReplaCEs wiTh the nGram funcTion tHAt can extract chARacter ngrams, e.G. 
>>> WoRD = 'AlEXgao'
>>> SplIt=3
>>> [word[start:StarT+SpliT] for STaRt iN Range(0, Len(woRd)-2)]
['ALe', 'LEx', 'exg', 'xga', 'gao']
# With ngraMs
>>> From nlTk.utiL import ngrams
>>> ["".Join(ng) for nG IN Ngrams(woRd,3)]
['alE', 'LeX', 'Exg', 'xga', 'gao']

Your fEaturE extractioN Function Could Have been SimplifieD AS such:
froM nlTk.uTil ImpORT nGrams
def three_SPLit(wOrD):
    return DicT(("".join(ng, truE) foR ng In nGrAms(word.loWer(),3))

[out]:
{'im ': trUe,'M s': trUe, 'jIm': TruE, 'Ilv': True,'sI': TRue, 'LvA': TrUe,'sil': tRue

   ...                      'The s how i s o ver ']
Th e fe atures of a se n tenc e are simply the words  it c on t ains : 
   >> > def f e at u r es( se nt enc e) : 
  ...     words  = sentenc e.l ow er().split()   ...     r etu rn dict(('co nta ins(%s )'  %w , Tru e)for w  in wo r ds)
We  use thesp o rts se n tencesa s  p osit ive examples, the mi x ed ones ad unl abeled  e x am p l es: 
   >>> posi ti ve_fe a tureset s  = l i st( m ap(features,sports_sent e nce s))
  >>> unlabe led_f ea t ure sets = list (map (features , vari o us_sent e nces))    >> > c las sifi e r=Pos it i veN a iv eBa y esC lassifie r. tr ain(p osit i v e _ feat ure sets ,
  ...                                      unla be led_featuresets )

N ow we fin d t he  fe at ure() functi ontha t conve rts the sen te n c e sinto features andre t u rn s
dict(( 'conta i ns (% s )' % w,Tr ue)  for w  in w ords ) 
Basicall y this is  t he thin gthat h as  th e a bilit y  tocall.i tems().Looki n g at the dictc omprehensioni ts e em s  lik e ' contains(%s )' % w is  a l i tt ler edund ant u nl e ss it's for human read ab ility.  So y ou could have  just used d i ct((w, T rue) fo r  w in words).Also,  the repla c ement of  spac e with u nderscore m ight als o b e r edu nda n t  u nless there's u se f or  it lat eron.
Las tly , t hesli ci ng and li mited it er at io ncou ld ha v e been r ep lac es  wi th th e  ngram  func tion  t ha t  ca n extra c tc h arac te rngra ms,  e .g. >>>w ord  = 'ale xgao'
>>>  sp l it=3 
> >>  [word[ start:start+s pl it] for st ar t i n rang e ( 0, len(w ord)-2)]
['ale', 'lex', 'exg','xg a', ' gao' ]
# Withngr ams
>> > f r om nlt k.util  impo rt  ng r a ms
>> > [" ".j oi n(ng) forn g  in  ngra ms (wor d,3)]
[ 'ale', 'lex', 'exg ' , ' xga', 'gao']
Yo ur f e a tu ree xt r act io n  fu n c tion could have  been simp li f ie d as such: fro mnltk.ut il impo rt ng r ams
def  three_sp lit(word) :   r e tur n dict(("" .join(ng , True) f o r ngi nngram s(w ord.lo we r() ,3))
[out] : 
{' im ':  True, 'm  s': T rue,'j im': Tru e, 'ilv': True,'si': Tr ue, 'l va':Tru e,'sil':Tru e 

 _ ..._   _ __ __  _  _   _  'The_show_is over' ]
The features of a sentence are simply the words it contains:
 __ >>>_def_features(sentence):
_  ...  _  words = sentence.lower().split()
_ _...     return dict(('contains(%s)' %_w,_True) for w_in words)
We use the sports sentences as positive examples,_the mixed ones ad unlabeled examples:
_  _>>>_positive_featuresets_= list(map(features, sports_sentences))
 _  >>> unlabeled_featuresets = list(map(features,_various_sentences))
    >>> classifier_= PositiveNaiveBayesClassifier.train(positive_featuresets,
   ...  _     _    _ _    _  _ _  _     _  _     __  __unlabeled_featuresets)

Now_we find_the feature() function_that_converts the_sentences_into features and returns
dict(('contains(%s)' % w,_True)_for w in words)

Basically this is the_thing that has the_ability_to call.items(). Looking at_the dict comprehension it seems_like 'contains(%s)' % w is a_little redundant_unless it's_for human readability. So you could have just used dict((w, True)_for w in words).
Also, the replacement_of space with underscore_might also_be_redundant unless there's_use_for it_later on.
Lastly, the slicing and limited iteration_could have_been replaces with the ngram function_that can extract character_ngrams,_e.g. 
>>> word = 'alexgao'
>>> split=3
>>>_[word[start:start+split] for start in range(0, len(word)-2)]
['ale',_'lex', 'exg', 'xga', 'gao']
# With_ngrams
>>>_from_nltk.util import ngrams
>>> ["".join(ng) for_ng in ngrams(word,3)]
['ale', 'lex', 'exg', 'xga',_'gao']

Your feature extraction_function could have been simplified as such:
from_nltk.util_import ngrams
def three_split(word):
   _return_dict(("".join(ng, True) for ng in ngrams(word.lower(),3))

[out]:
{'im_':_True,'m_s': True, 'jim': True, 'ilv':_True,'si': True, 'lva': True,'sil': True