Surround is a lightweight framework for serving machine learning pipelines in Python. It is designed to be flexible, easy to use and to assist data scientists by focusing them on the problem at hand rather than writing glue code. Surround began as a project at the Applied Artificial Intelligence Institute to address the following problems:
A short explanation is provided in the hello-world example's README file.
import logging
from surround import State, Stage, Estimator, Assembler, RunMode
class HelloWorld(Estimator):
def estimate(self, state, config):
state.text = "Hello world"
def fit(self, state, config):
print("No training implemented")
class InputValidator(Stage):
def operate(self, state, config):
if state.text:
raise ValueError("'text' is not None")
class AssemblerState(State):
text = None
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
data = AssemblerState()
assembler = Assembler("Hello world example").set_stages([InputValidator(), HelloWorld()])
assembler.run(data, mode=RunMode.PREDICT)
print("Text is '%s'" % data.text)
See the examples directory for useful examples on how Surround can be utilized.
See our website for an in-depth explanation of Surround (in the About page), a Getting Started Guide, and full documentation of the API.
For guidance on setting up a development environment and how to make a contribution to Surround, see the contributing guidelines.
Surround is released under a BSD-3 license.
Surround is currently under heavy development, please submit any issues that occur or suggestions you may have, it is very much appreciated!