<s> from sumpy . system . _base import _SystemBase <EOL> from sumpy . annotators import MonotoneSubmodularMixin , SubmodularMMRMixin <EOL> from sumpy . document import Summary <EOL> class SubmodularMMRSummarizer ( SubmodularMMRMixin , _SystemBase ) : <EOL> def __init__ ( self , sentence_tokenizer = None , word_tokenizer = None , <EOL> lam = <NUM_LIT> , budget_type = "<STR_LIT>" , budget_size = <NUM_LIT> , scale = <NUM_LIT> , <EOL> verbose = False ) : <EOL> self . sentence_tokenizer = sentence_tokenizer <EOL> self . word_tokenizer = word_tokenizer <EOL> self . lam = lam <EOL> self . scale = scale <EOL> self . budget_type = budget_type <EOL> self . budget_size = budget_size <EOL> super ( SubmodularMMRSummarizer , self ) . __init__ ( verbose = verbose ) <EOL> def build_summary ( self , input_df , ndarray_data ) : <EOL> output_df = input_df [ input_df [ "<STR_LIT>" ] . isnull ( ) == False ] <EOL> output_df = output_df . sort ( [ "<STR_LIT>" , "<STR_LIT>" ] , ascending = True ) <EOL> print output_df <EOL> print output_df [ '<STR_LIT>' ] . apply ( len ) <EOL> return Summary ( output_df ) <EOL> class MonotoneSubmodularBasic ( MonotoneSubmodularMixin , _SystemBase ) : <EOL> def __init__ ( self , sentence_tokenizer = None , word_tokenizer = None , <EOL> k = <NUM_LIT:5> , f_of_A = None , verbose = False ) : <EOL> self . sentence_tokenizer = sentence_tokenizer <EOL> self . word_tokenizer = word_tokenizer <EOL> self . k = k <EOL> self . f_of_A = f_of_A <EOL> super ( MonotoneSubmodularBasic , self ) . __init__ ( verbose = verbose ) <EOL> def build_summary ( self , input_df , ndarray_data ) : <EOL> output_df = input_df [ input_df [ "<STR_LIT>" ] == <NUM_LIT:1> ] <EOL> output_df = output_df . sort ( [ "<STR_LIT>" , "<STR_LIT>" ] , ascending = True ) <EOL> return Summary ( output_df ) </s>
