MCPcopy Create free account
hub / github.com/chengsen/PyTorch_TextGCN / lean_str_sst

Method lean_str_sst

data_processor.py:58–65  ·  view source on GitHub ↗

Tokenization/string cleaning for the SST yelp_dataset Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py

(self, string)

Source from the content-addressed store, hash-verified

56 return " ".join(new_doc).lower()
57
58 def lean_str_sst(self, string):
59 """
60 Tokenization/string cleaning for the SST yelp_dataset
61 Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py
62 """
63 string = re.sub(self.other_char, " ", string)
64 string = re.sub(r"\s{2,}", " ", string)
65 return string.strip().lower()
66
67 def remove_stopword(self, string):
68 if self.stop_words is None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected