From 5a9665edf77f446eefc534ee0437648236cf3b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Shivanand=20Roy=20=F0=9F=91=8B?= Date: Sun, 20 Jun 2021 21:18:04 +0000 Subject: [PATCH] Update README.md --- README.md | 73 +++++++++++++++++++++++-------------------------------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index e99ab25..85e3d61 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,13 @@ tags: widget: -- text: "summarize: We describe a system called Overton, whose main design goal is to support engineers in building, monitoring, and improving production machine learning systems. Key challenges engineers face are monitoring fine-grained quality, diagnosing errors in sophisticated applications, and handling contradictory or incomplete supervision data. Overton automates the life cycle of model construction, deployment, and monitoring by providing a set of novel high-level, declarative abstractions. Overton's vision is to shift developers to these higher-level tasks instead of lower-level machine learning tasks. In fact, using Overton, engineers can build deep-learning-based applications without writing any code in frameworks like TensorFlow. For over a year, Overton has been used in production to support multiple applications in both near-real-time applications and back-of-house processing. In that time, Overton-based applications have answered billions of queries in multiple languages and processed trillions of records reducing errors 1.7-2.9 times versus production systems." +- text: "summarize: We describe a system called Overton, whose main design goal is to support engineers in building, monitoring, and improving production +machinelearning systems. Key challenges engineers face are monitoring fine-grained quality, diagnosing errors in sophisticated applications, and +handling contradictory or incomplete supervision data. Overton automates the life cycle of model construction, deployment, and monitoring by providing a set of novel high-level, declarative abstractions. Overton's vision is to shift developers to these higher-level tasks instead of lower-level machine learning tasks. +In fact, using Overton, engineers can build deep-learning-based applications without writing any code in frameworks like TensorFlow. For over a year, +Overton has been used in production to support multiple applications in both near-real-time applications and back-of-house processing. +In that time, Overton-based applications have answered billions of queries in multiple languages and processed trillions of records reducing errors +1.7-2.9 times versus production systems." license: mit @@ -20,57 +26,38 @@ license: mit A T5 model trained on 370,000 research papers, to generate one line summary based on description/abstract of the papers Trained with [**simpleT5**](https://https://github.com/Shivanandroy/simpleT5)⚡️in just 3 lines of code -> [**simpleT5**](https://https://github.com/Shivanandroy/simpleT5)⚡️ is a python package built on top of **pytorch lightning** and **transformers**🤗, to quickly train T5 models. +- [**simpleT5**](https://https://github.com/Shivanandroy/simpleT5)⚡️ is a python package built on top of **pytorch lightning** and **transformers**🤗, to quickly train T5 models. ## Usage:[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1HrfT8IKLXvZzPFpl1EhZ3s_iiXG3O2VY?usp=sharing) ```python +abstract = """We describe a system called Overton, whose main design goal is to support engineers in building, monitoring, and improving production machine learning systems. Key challenges engineers face are monitoring fine-grained quality, diagnosing errors in sophisticated applications, and handling contradictory or incomplete supervision data. Overton automates the life cycle of model construction, deployment, and monitoring by providing a set of novel high-level, declarative abstractions. Overton's vision is to shift developers to these higher-level tasks instead of lower-level machine learning tasks. In fact, using Overton, engineers can build deep-learning-based applications without writing any code in frameworks like TensorFlow. For over a year, Overton has been used in production to support multiple applications in both near-real-time applications and back-of-house processing. In that time, Overton-based applications have answered billions of queries in multiple languages and processed trillions of records reducing errors 1.7-2.9 times versus production systems. +""" +``` +Transformers🤗 +```python model_name = "snrspeaks/t5-one-line-summary" from transformers import AutoModelForSeq2SeqLM, AutoTokenizer - model = AutoModelForSeq2SeqLM.from_pretrained(model_name) tokenizer = AutoTokenizer.from_pretrained(model_name) - -abstract = """We describe a system called Overton, whose main design goal is to -support engineers in building, monitoring, and improving production machine learning systems. -Key challenges engineers face are monitoring fine-grained quality, diagnosing errors in -sophisticated applications, and handling contradictory or incomplete supervision data. -Overton automates the life cycle of model construction, deployment, and monitoring by providing a -set of novel high-level, declarative abstractions. Overton's vision is to shift developers to -these higher-level tasks instead of lower-level machine learning tasks. In fact, using Overton, -engineers can build deep-learning-based applications without writing any code -in frameworks like TensorFlow. For over a year, Overton has been used in production to support multiple -applications in both near-real-time applications and back-of-house processing. -In that time, Overton-based applications have answered billions of queries in multiple -languages and processed trillions of records reducing errors 1.7-2.9 times versus production systems. -""" - -input_ids = tokenizer.encode( - "summarize: " + abstract, return_tensors="pt", add_special_tokens=True -) - -generated_ids = model.generate( - input_ids=input_ids, - num_beams=5, - max_length=50, - repetition_penalty=2.5, - length_penalty=1, - early_stopping=True, - num_return_sequences=3, -) - -preds = [ - tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=True) - for g in generated_ids -] - +input_ids = tokenizer.encode("summarize: " + abstract, return_tensors="pt", add_special_tokens=True) +generated_ids = model.generate(input_ids=input_ids,num_beams=5,max_length=50,repetition_penalty=2.5,length_penalty=1,early_stopping=True,num_return_sequences=3) +preds = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=True) for g in generated_ids] print(preds) # output - -['Overton: Building, Deploying, and Monitoring Machine Learning Systems for Engineers', - - 'Overton: A System for Building, Monitoring, and Improving Production Machine Learning Systems', - - 'Overton: Building, Monitoring, and Improving Production Machine Learning Systems'] +["Overton: Building, Deploying, and Monitoring Machine Learning Systems for Engineers", + "Overton: A System for Building, Monitoring, and Improving Production Machine Learning Systems", + "Overton: Building, Monitoring, and Improving Production Machine Learning Systems"] ``` +simpleT5⚡️ +```python +# pip install --upgrade simplet5 +from simplet5 import SimpleT5 +model = SimpleT5() +model.load_model("t5","snrspeaks/t5-one-line-summary") +model.predict(abstract) + +# output +"Overton: Building, Deploying, and Monitoring Machine Learning Systems for Engineers" +``` \ No newline at end of file