language:en license:cc-by-4.0 size_categories:n<1K modality:text region:us
---
language:
- en
license:
- cc-by-4.0
pretty_name: Social and Health Care Service Descriptions
---

# Social and Health Care Service Descriptions

This repository hosts a dataset of service descriptions for social and health care services provided by the city of Helsinki.

The data is sourced from the *TPR Service Description Register REST API* (see [here](https://www.hel.fi/palvelukarttaws/restpages/palvelurekisteri_en.html) for more details).

The service descriptions are shared under a Creative Commons 4.0 BY license, explicitly permitting data sharing and remixing.

## Dataset Construction

The dataset was constructed by fetching service descriptions from the REST API. The query targeted services under the `SOCIAL_AND_HEALTH_SERVICES` main theme and returned 361 services with English language descriptions.

```python
url = 'https://www.hel.fi/palvelukarttaws/rest/vpalvelurekisteri/description/'

params = {'maintheme': 'SOCIAL_AND_HEALTH_SERVICES',
          'alldata': 'yes',
          'language': 'en'}
```
Each service description may link to additional errand services. The additional 64 errand service descriptions of linked services were also retrieved:
```python
for shs in shs_json:
    errand_services_list += shs['exact_errand_services']

errand_service_set = set(errand_services_list)

for errand_service_id in errand_service_set:
    url = 'https://www.hel.fi/palvelukarttaws/rest/vpalvelurekisteri/errandservice/' + str(errand_service_id)
    params = {'language': 'en', 'alldata': 'yes'}
```

## Dataset contents

The dataset is comprised of two files:

1. `shs_descriptions.json.gz`: This file combines the JSON service descriptions returned by the API, the text descriptions, and the text embeddings into a single JSON file.

2. `chroma.sqlite3`: This is a Chroma DB file that uses the text embeddings to index the service text descriptions.

### Service Descriptions

The service descriptions are provided in JSON format as returned by the API. 

### Text desciptions

Text descriptions combine service information from the JSON description and linked errand services into a single description for each service. The descriptions have been refined, with relevant fields selected and additional processing performed on e.g. target groups and contact channels associated with the services.

### Text Embeddings

Embeddings of the text descriptions have been created using OpenAI's `text-embedding-ada-002` model.


