{"id":19733978,"url":"https://github.com/scaleoutsystems/transformers-example-project","last_synced_at":"2025-11-22T08:03:17.120Z","repository":{"id":104982594,"uuid":"294128858","full_name":"scaleoutsystems/transformers-example-project","owner":"scaleoutsystems","description":"STACKn example - deployment of a Swedish BERT model developed at the Swedish Unemployment Agency","archived":false,"fork":false,"pushed_at":"2021-10-11T13:55:32.000Z","size":153,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T04:09:11.774Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scaleoutsystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-09T13:57:21.000Z","updated_at":"2021-10-11T13:55:35.000Z","dependencies_parsed_at":"2023-05-07T11:31:08.195Z","dependency_job_id":null,"html_url":"https://github.com/scaleoutsystems/transformers-example-project","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scaleoutsystems/transformers-example-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2Ftransformers-example-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2Ftransformers-example-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2Ftransformers-example-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2Ftransformers-example-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scaleoutsystems","download_url":"https://codeload.github.com/scaleoutsystems/transformers-example-project/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2Ftransformers-example-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285755372,"owners_count":27226259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-22T02:00:05.934Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T00:34:50.301Z","updated_at":"2025-11-22T08:03:17.104Z","avatar_url":"https://github.com/scaleoutsystems.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Transformer example project\n\nThis STACKn example project demonstrates how to deploy the Swedish BERT model developed by the Swedish Unemployment Agency: https://github.com/af-ai-center/SweBERT.git and publish live prediction endpoints to a STACKn model portal.\n\n***\n\n## BERT and the Swedish BERT models\n\n\nThe realease of the BERT architecture is seen as one of the major breakthroughs in NLP (natural language processing) in the last few years. BERT has presented state of the art results across a number of different use cases, such as document classification, sentiment analysis, natural language inference, questions answering, sentence similarity and more.\n\nArbetsförmedlingen (The Swedish Public Employment Service) has developed Swedish BERT models which were trained on Swedish Wikipedia with approximately 2 million articles and 300 million words.\n\n## Getting started\n\nPlease follow and refer to [these detailed steps](https://github.com/scaleoutsystems/examples/tree/main/tutorials/studio/quickstart#transformers-example-project) in order to create a \"STACKn Default\" project and correclty set up a Jupiter instance.\n\nClone this repository:\n\n    $ git clone https://github.com/scaleoutsystems/transformers-example-project.git\n\nand then install the pip requirements and enable the Jupyter notebook extension:\n    \n    $ pip install -r requirements.txt\n    $ jupyter nbextension enable --py widgetsnbextension\n    \nNow you should be ready to open the `getting_started_with_swebert.ipynb` in the _notebooks_ folder. Please follow the notebook's instructions.\n\n## Deploying the model\n\nOnce you have run all the cells in the above notebook, open up again a terminal in your Jupyter Lab session and execute the following command within the repository directory:\n\n- `stackn create object afbert -r minor` (**Note:** add the flag `--insecure` in case you have deployed STACKn locally with a self-signed certificate)\n\n- `stackn get objects` (**Note:** add the flag `--insecure` in case you have deployed STACKn locally with a self-signed certificate)\n\n(Check that the model is listed; you should be able to see the newly created model object in your Studio UI, under the \"_Objects_\" tab)\n\nDeploy the newly created model object with the \"_Python Model Deployment_\" component (under the \"_Serve_\" tab in Studio). _Name_ can be anything, _Model_ should match the name of the newly created model (e.g. \"afbert:v0.1.0\"); leave the rest as defaults.\n\n**Note:** It could take some time for this model to initialize, so keep checking the logs until it is available and wait until it is running successfully.\n\n## Run the prediction\n\nOnce the above serving app is up and running, copy the endpoint URL by right-clicking on the _Open_ link.\n\nGo back to your Jupyter Lab session and open the `predict.ipynb` notebook under the _notebooks_ folder. Paste the copied URL at line 12 in order to use the correct endpoint for the prediction. It is time to test the prediction! Run all the cells and check the results.\n\n**Tips:** You can play around by changing the values of the `example` and `msk_ind` variables. The latter will mask (or \"hide\") one of the words in the example sentence; then the prediction will shown the possible candidates for such \"missing\" word.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaleoutsystems%2Ftransformers-example-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscaleoutsystems%2Ftransformers-example-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaleoutsystems%2Ftransformers-example-project/lists"}