Software Engineering Principles in Python
Adam Spannbauer
Machine Learning Engineer at Eastman
class Document:
def __init__(self, text):
self.text = text
class Document:
def __init__(self, text):
self.text = text
class Document: def __init__(self, text): self.text = text self.tokens = self._tokenize()
doc = Document('test doc') print(doc.tokens)
['test', 'doc']
# Import function to perform tokenization from .token_utils import tokenize
class Document: def __init__(self, text, token_regex=r'[a-zA-Z]+'): self.text = text self.tokens = self._tokenize()
def _tokenize(self): return tokenize(self.text)
Lack of documentation
Unpredictability
Software Engineering Principles in Python