Snippet: Query Ollama Deepseek through Python in JupyterLab

Alexander Dunkel, Leibniz Institute of Ecological Urban and Regional Development, Transformative Capacities & Research Data Centre (IÖR-FDZ)

No description has been provided for this image

Prerequisites:

  • ollama serve must listen on localhost on port 11434
  • jupyter docker must be in networking: host mode

See my related blog post for the setup behind this.

1  Test connect

In [1]:
import requests

url = "http://localhost:11434/api/generate"
data = {
    "model": "deepseek-r1:32b",
    "prompt": "What is the meaning of life?",
    "stream": False
}

response = requests.post(url, json=data)
print(response.json())
{'model': 'deepseek-r1:32b', 'created_at': '2025-03-31T06:31:29.677988034Z', 'response': '<think>\n\n</think>\n\nThe meaning of life is a profound and complex question that has been pondered by philosophers, theologians, and individuals throughout history. Different people and cultures have various interpretations based on their beliefs, experiences, and perspectives.\n\nSome common views include:\n\n1. **Purposeful Life**: For many, the meaning of life is about finding purpose or contributing to something greater than oneself, such as helping others, pursuing personal goals, or serving a higher power.\n\n2. **Happiness and Fulfillment**: Others believe that the meaning of life lies in seeking happiness, joy, and fulfillment through experiences, relationships, and self-growth.\n\n3. **Existential Perspective**: From an existential viewpoint, individuals are free to create their own meaning, as there is no predefined purpose imposed by external forces.\n\n4. **Religious or Spiritual Beliefs**: In many religions, the meaning of life is tied to divine principles, such as achieving union with God, following religious teachings, or preparing for an afterlife.\n\nUltimately, the meaning of life may be something each person must discover for themselves, as it can evolve over time and vary greatly from one individual to another.', 'done': True, 'done_reason': 'stop', 'context': [151644, 3838, 374, 279, 7290, 315, 2272, 30, 151645, 151648, 271, 151649, 198, 198, 785, 7290, 315, 2272, 374, 264, 27155, 323, 6351, 3405, 429, 702, 1012, 47783, 291, 553, 60687, 11, 89502, 5380, 11, 323, 7775, 6814, 3840, 13, 33396, 1251, 323, 26735, 614, 5257, 57589, 3118, 389, 862, 20799, 11, 11449, 11, 323, 38455, 13, 198, 198, 8373, 4185, 6194, 2924, 25, 198, 198, 16, 13, 220, 334, 74033, 1262, 9414, 95518, 1752, 1657, 11, 279, 7290, 315, 2272, 374, 911, 9271, 7428, 476, 28720, 311, 2494, 7046, 1091, 56569, 11, 1741, 438, 10476, 3800, 11, 33018, 4345, 8845, 11, 476, 13480, 264, 5080, 2355, 13, 198, 198, 17, 13, 220, 334, 39, 66291, 323, 47450, 7559, 478, 95518, 25028, 4411, 429, 279, 7290, 315, 2272, 15448, 304, 10887, 23009, 11, 15888, 11, 323, 56283, 1526, 11449, 11, 11871, 11, 323, 656, 12, 73089, 13, 198, 198, 18, 13, 220, 334, 25613, 2283, 69188, 95518, 5542, 458, 66639, 58385, 11, 7775, 525, 1910, 311, 1855, 862, 1828, 7290, 11, 438, 1052, 374, 902, 63062, 7428, 25980, 553, 9250, 8437, 13, 198, 198, 19, 13, 220, 334, 6740, 22153, 476, 62749, 7828, 29821, 95518, 758, 1657, 43130, 11, 279, 7290, 315, 2272, 374, 17339, 311, 29367, 16170, 11, 1741, 438, 31045, 11300, 448, 4264, 11, 2701, 10381, 44472, 11, 476, 20045, 369, 458, 1283, 14450, 13, 198, 198, 66243, 11, 279, 7290, 315, 2272, 1231, 387, 2494, 1817, 1697, 1969, 6997, 369, 5577, 11, 438, 432, 646, 37580, 916, 882, 323, 13289, 18875, 504, 825, 3842, 311, 2441, 13], 'total_duration': 18827096529, 'load_duration': 12377329352, 'prompt_eval_count': 10, 'prompt_eval_duration': 185000000, 'eval_count': 235, 'eval_duration': 6262000000}

We can get the answer directly, formatted as Markdown:

In [7]:
from IPython.display import display, Markdown
display(Markdown(response.json().get('response')))

The meaning of life is a profound and complex question that has been pondered by philosophers, theologians, and individuals throughout history. Different people and cultures have various interpretations based on their beliefs, experiences, and perspectives.

Some common views include:

  1. Purposeful Life: For many, the meaning of life is about finding purpose or contributing to something greater than oneself, such as helping others, pursuing personal goals, or serving a higher power.

  2. Happiness and Fulfillment: Others believe that the meaning of life lies in seeking happiness, joy, and fulfillment through experiences, relationships, and self-growth.

  3. Existential Perspective: From an existential viewpoint, individuals are free to create their own meaning, as there is no predefined purpose imposed by external forces.

  4. Religious or Spiritual Beliefs: In many religions, the meaning of life is tied to divine principles, such as achieving union with God, following religious teachings, or preparing for an afterlife.

Ultimately, the meaning of life may be something each person must discover for themselves, as it can evolve over time and vary greatly from one individual to another.

2  Load Geosocial Media (DE) data

In [3]:
import pandas as pd

This CSV file contains all Geosocial Media Posts in Germany, sorted by (psyeudonymized) User-ID, starting with the user with the most posts.

In [4]:
from pathlib import Path

file_path = Path.cwd() / "00_data" / "2025-03-24_DE_All.csv"
size_gb = file_path.stat().st_size / (1024 ** 3)

print(f"File size: {size_gb:.2f} GB")
File size: 21.03 GB

The data includes data from Twitter, Flickr, Instagram and iNaturalist.

Query the first entries:

In [5]:
# Read the file in chunks
chunk_size = 100
chunk_iterator = pd.read_csv(file_path, chunksize=chunk_size)

# Get the first 100 rows
df_first_100 = next(chunk_iterator)

# Display the first few rows
print(df_first_100.head())
   origin_id                                    post_guid   latitude  \
0          3  5ygTWSTbMQ7QU5Vg6sFwVVgbB4zYpRk3RrnPQJ4ERcw  49.702159   
1          3  6q8ee/JHdlNtiirxBhBMzhP1EaO9l0FS8IubiVlvJlI  49.702232   
2          3  tYygZQLmxC6LVXsPjpvWq3lkYkqKPQ1NRF0mW+zTPDQ  49.702121   
3          3  eafW+feK/LVpsB4WZCeyaEb1rj7klWMpXpPNuFNXpBA  49.702106   
4          3  BdeUvs3RzIxIbiDOIdQBw4iknyXm7lLB+CvHzAZSlMw  49.702066   

   longitude                                    user_guid  post_create_date  \
0   8.243005  TUNIaePFEoHqL1OWiWFAV3wl0n/c4YC4POwZ4x8wJUw               NaN   
1   8.242842  TUNIaePFEoHqL1OWiWFAV3wl0n/c4YC4POwZ4x8wJUw               NaN   
2   8.243016  TUNIaePFEoHqL1OWiWFAV3wl0n/c4YC4POwZ4x8wJUw               NaN   
3   8.242845  TUNIaePFEoHqL1OWiWFAV3wl0n/c4YC4POwZ4x8wJUw               NaN   
4   8.242931  TUNIaePFEoHqL1OWiWFAV3wl0n/c4YC4POwZ4x8wJUw               NaN   

     post_publish_date  post_thumbnail_url  post_views_count  post_like_count  \
0  2016-06-12 16:55:56                 NaN               NaN              NaN   
1  2017-12-15 13:06:27                 NaN               NaN              NaN   
2  2016-06-01 22:51:55                 NaN               NaN              NaN   
3  2016-06-04 00:03:43                 NaN               NaN              NaN   
4  2016-06-02 08:13:34                 NaN               NaN              NaN   

   post_url                  tags  emoji  post_title  \
0       NaN        ALDUBAllMyLife    NaN         NaN   
1       NaN  ALDUBKeepingTheFaith    NaN         NaN   
2       NaN     ALDUB46thWeeksary    NaN         NaN   
3       NaN     ALDUBTellTheTruth    NaN         NaN   
4       NaN     ALDUB46thWeeksary    NaN         NaN   

                                           post_body post_geoaccuracy  \
0  I will always try my best for you sweet heart....           latlng   
1  I am single but not available. #ALDUBKeepingTh...           latlng   
2  He who has a why to live can bear almost any h...           latlng   
3  The best way to succeed in life is to act on t...           latlng   
4  My religion is very simple. My religion is kin...           latlng   

   post_comment_count post_type  post_filter  place_guid  
0                 NaN      text          NaN         NaN  
1                 NaN      text          NaN         NaN  
2                 NaN      text          NaN         NaN  
3                 NaN      text          NaN         NaN  
4                 NaN      text          NaN         NaN  
In [78]:
%%time
def process_user_guid(df):
    """Process all rows of a single user_guid."""
    user_guid = df["user_guid"].iloc[0]
    print(f"Processing user_guid: {user_guid}, Rows: {len(df)}")

processed_rows_count = 11505815       # Track the number of rows processed so far
chunk_size = 100000  # Process larger chunks to reduce overhead
processed_users = 0
max_users = 1  # Process first 3 unique user GUIDs

buffer = [] 
current_user_guid = None

# Read only the 'post_body' and 'user_guid' columns, ignore the rest
columns_to_read = ['user_guid', 'post_body']

header = pd.read_csv(file_path, nrows=1)  # This reads just the first row

for chunk in pd.read_csv(
    file_path, chunksize=chunk_size, usecols=columns_to_read, header=None, 
    names=header.columns, low_memory=False, skiprows=processed_rows_count):
    # Skip rows already processed (if any)
    chunk['is_valid'] = chunk['post_body'].notna()  # Mark rows as valid (True) or invalid (False)
    
    for _, row in chunk.iterrows():
        processed_rows_count += 1
        user_guid = row["user_guid"]

        # Skip rows where 'post_body' is NaN
        if not row['is_valid']:
            continue  # Skip this row
            
        if current_user_guid is None:
            # First row case
            current_user_guid = user_guid

        if user_guid == current_user_guid:
            # Accumulate rows for the same user_guid
            if row['post_body']:
                # if not n/a
                buffer.append(row)  # Collect rows in the buffer (list)
        else:
            # Process the previous user_guid
            process_user_guid(pd.DataFrame(buffer))
            processed_users += 1

            if processed_users >= max_users:
                print(f"Processed {processed_rows_count} rows so far.")
                # Stop once we've processed `max_users` user GUIDs
                break

            # Start a new buffer for the next user_guid
            buffer = [row]  # Start with the new row
            current_user_guid = user_guid

    if processed_users >= max_users:
        break  # Stop processing further chunks

# Process any remaining user_guid in the buffer (if within max_users)
if buffer and processed_users < max_users:
    process_user_guid(pd.DataFrame(buffer))  # Process remaining buffered rows
Processing user_guid: xpEphrnRFm8YKiwSv+x/0f2D2a5brw0CKidOkGtz0k4, Rows: 3668
Processed 11509484 rows so far.
CPU times: user 19.1 s, sys: 1.46 s, total: 20.6 s
Wall time: 21.5 s

The first user with the highest activity on Social Media in Germany has 584688 posts. The second highest active user has 305. And so on. Note: this excludes empty post_body, so the second user mayhave many more posts, just without text (maybe only emoji, or only pictures etc.).

Let's look at some posts from user 4.

In [79]:
for ix in range(20):
    print(buffer[ix].post_body)
Wer hat seinen Wecker vergessen abzuschalten? 🤡😴
Juhuuu 😁 jetzt #Eurovision mit @Alina_Stiegler von @eurovisionde #DareToDream https://t.co/vZwVi7Llbs
Mittag in der @Sansibar1978 ... #currywurst #ftw https://t.co/7Mz3UBzchc
#zwischenwach
Wenn man keine Antworten hat, holt die JU das "Vaterland" raus und behauptet, dass der politische Gegner keine Ahnung davon habe. Konservative sind die Sackgasse! #niewiederCDU https://t.co/eHJguIVqL0
Wir gehen gerade alle Wortspiele zum Thema Wild durch 😬 https://t.co/BU74BPy2fz
Okay, irgendwie cool, irgendwie Retro ... Mir erschließt es sich nicht, weil zu creepy #svn #Eurovision
https://t.co/1Utx8KoS2G
Wadehaddedudeda auf Georgisch #geo #Eurovision
Weil ich es kann 😊 #strand #grillen #kiel https://t.co/VYzMYJCZCd
Ich hab gerade mal geguckt, ob @BrestFr eine Möglichkeit wäre, mein Fernweh zu behandeln ... Leute, ein 3Tage Busticket für die Stadt kostet 9€ 😲 so geht #ÖPNV
Das Beste am alleine sein? Mit offener Hose quer auf der Couch liegen und rülpsen ... hach ....
Gänsehaut ...  das! So! Geil! #lovingyouisalosinggame #ned #EUROVISION
Neues Auto kommt, wenn es der Verkehr zulässt, morgen an 🎉 https://t.co/r2IEbXP6sy
Weil gerade im Umfeld von Greta Tweets wieder jede Menge Vollidioten retweetet werden: HÖRT AUF DAMIT! Macht nen Screenshot und twittert diesen. Hört auf dummen Menschen Reichweite zu geben! #kthxbye
Morgen um diese Zeit für das @barcampkiel anmelden!!!1!!!11 #bcki
Ach herrje ... die Roboter wurden reaktiviert ... SLICE HIM!!! #aze #EUROVISION
So auf geht's zweites Halbfinale #Eurovision #DareToDream
Gott ist das albern 🙄 #aze #EUROVISION
Jetzt #arm ... Das Video war geil ... Stimme ist gut ... Irgendwie gut umgesetzt #Eurovision

3  Classify using prompt

Let's write a prompt to classify some of these posts. We first need to group several posts, so there is a better base for evaluation.

In [85]:
social_media_posts = "__next_post__: ".join([row["post_body"] for row in buffer[:20]])
In [86]:
social_media_posts
Out[86]:
'Wer hat seinen Wecker vergessen abzuschalten? 🤡😴__next_post__: Juhuuu 😁 jetzt #Eurovision mit @Alina_Stiegler von @eurovisionde #DareToDream https://t.co/vZwVi7Llbs__next_post__: Mittag in der @Sansibar1978 ... #currywurst #ftw https://t.co/7Mz3UBzchc__next_post__: #zwischenwach__next_post__: Wenn man keine Antworten hat, holt die JU das "Vaterland" raus und behauptet, dass der politische Gegner keine Ahnung davon habe. Konservative sind die Sackgasse! #niewiederCDU https://t.co/eHJguIVqL0__next_post__: Wir gehen gerade alle Wortspiele zum Thema Wild durch 😬 https://t.co/BU74BPy2fz__next_post__: Okay, irgendwie cool, irgendwie Retro ... Mir erschließt es sich nicht, weil zu creepy #svn #Eurovision__next_post__: https://t.co/1Utx8KoS2G__next_post__: Wadehaddedudeda auf Georgisch #geo #Eurovision__next_post__: Weil ich es kann 😊 #strand #grillen #kiel https://t.co/VYzMYJCZCd__next_post__: Ich hab gerade mal geguckt, ob @BrestFr eine Möglichkeit wäre, mein Fernweh zu behandeln ... Leute, ein 3Tage Busticket für die Stadt kostet 9€ 😲 so geht #ÖPNV__next_post__: Das Beste am alleine sein? Mit offener Hose quer auf der Couch liegen und rülpsen ... hach ....__next_post__: Gänsehaut ...  das! So! Geil! #lovingyouisalosinggame #ned #EUROVISION__next_post__: Neues Auto kommt, wenn es der Verkehr zulässt, morgen an 🎉 https://t.co/r2IEbXP6sy__next_post__: Weil gerade im Umfeld von Greta Tweets wieder jede Menge Vollidioten retweetet werden: HÖRT AUF DAMIT! Macht nen Screenshot und twittert diesen. Hört auf dummen Menschen Reichweite zu geben! #kthxbye__next_post__: Morgen um diese Zeit für das @barcampkiel anmelden!!!1!!!11 #bcki__next_post__: Ach herrje ... die Roboter wurden reaktiviert ... SLICE HIM!!! #aze #EUROVISION__next_post__: So auf geht\'s zweites Halbfinale #Eurovision #DareToDream__next_post__: Gott ist das albern 🙄 #aze #EUROVISION__next_post__: Jetzt #arm ... Das Video war geil ... Stimme ist gut ... Irgendwie gut umgesetzt #Eurovision'
In [88]:
llm_prompt = f"""
"You are an expert in urban planning and sustainability. Your task is to evaluate geosocial media posts and classify them based on the degree to which they demonstrate "Urban Transformative Capacity" (UTC). UTC refers to the collective ability of stakeholders in urban development to conceive of, prepare for, initiate, and perform path-deviant change towards sustainability within and across multiple complex systems that constitute cities.

**Here's a breakdown of the key components of UTC, which you should use to inform your classification:**

*   **C1: Inclusive and Multiform Urban Governance:** Does the post suggest broad participation, diverse governance modes, and effective intermediaries?
*   **C2: Transformative Leadership:** Does the post indicate visionary, inclusive, and collaborative leadership that drives change?
*   **C3: Empowered and Autonomous Communities of Practice:** Does the post highlight the empowerment of communities to address social needs and exercise autonomy?
*   **C4: System(s) Awareness and Memory:** Does the post show understanding of urban systems, path dependencies, and the need for collective learning?
*   **C5: Urban Sustainability Foresight:** Does the post suggest the creation of collective visions and alternative scenarios for a sustainable urban future?
*   **C6: Diverse Community-Based Experimentation:** Does the post showcase innovative and disruptive solutions developed at the community level?
*   **C7: Innovation Embedding and Coupling:** Does the post indicate efforts to integrate new ideas into routines, organizations, plans, and legal frameworks?
*   **C8: Reflexivity and Social Learning:** Does the post suggest ongoing monitoring, assessment, and evaluation of transformative initiatives?
*   **C9: Working Across Agency Levels:** Does the post highlight actions that involve individuals, households, groups, organizations, networks, and society at large?
*   **C10: Working Across Political-Administrative Levels and Geographical Scales:** Does the post show consideration of interactions between local, regional, national, and global levels?

**Classification Instructions:**

Based on the content of the geosocial media post, assign a numerical score between 0 and 1, where:

*   **0:**  The post shows no evidence of UTC or relates to the issues mentioned above.
*   **0.2:** The post touches upon one or two isolated elements related to any of the TC components.
*   **0.4:** The post refers to a few of the TC components and reflects a certain awareness of them.
*   **0.6:** The post refers to a good understanding of at least one TC component.
*   **0.8:** The post exhibits a deeper understanding and reflects a relationship between at least a few TC components.
*   **1:** The post shows a comprehensive understanding and reflects relationships across many of the TC components and the holistic concept of TC.

**Output:**

Your response should be a single number between 0 and 1, representing the degree of Urban Transformative Capacity demonstrated in the post. Do not include any text or explanation beyond the numerical score.

**Examples:**

*   **Post:** "Another new car park is planned in the City. More cars, more traffic."
    **Classification:** 0
*   **Post:** "Attending a town hall meeting about improving our city's recycling program."
    **Classification:** 0.2
*   **Post:** "Great turnout at the community garden workshop! So many people eager to learn how to grow their own food."
    **Classification:** 0.4
*   **Post:** "Excited to be part of the city council's new initiative to promote energy efficiency in homes and businesses."
    **Classification:** 0.6
*   **Post:** "Our neighborhood association is working with local businesses to create a green business certification program. We're building a more sustainable community, one business at a time!"
    **Classification:** 0.8
*   **Post:** "Delighted to see the city adopting a multi-stakeholder approach, fostering a common vision, embedding innovative concepts to address our sustainability concerns by providing reflexive governance to the city's system!"
    **Classification:** 1

Now, classify the following geosocial media post:{social_media_posts}
"""
In [89]:
data = {
    "model": "deepseek-r1:32b",
    "prompt": llm_prompt,
    "stream": False
}

response = requests.post(url, json=data)
print(response.json())
{'model': 'deepseek-r1:32b', 'created_at': '2025-03-25T12:47:36.669059899Z', 'response': "<think>\nOkay, let me try to figure out how to classify this geosocial media post based on Urban Transformative Capacity (UTC). First, I need to understand what UTC entails. It's about the collective ability of urban stakeholders to drive sustainable change across various systems in a city. There are 10 key components, from C1 to C10.\n\nLooking at the posts provided, they seem to be a series of tweets or social media updates. Let me go through each one and see if any relate to UTC.\n\nThe first post mentions someone forgetting to turn off their alarm, which doesn't seem relevant. Then there are several about Eurovision, like attending the event or discussing performances. These don’t directly tie into urban planning or sustainability.\n\nNext, a post talks about going to Sansibar1978 and mentions currywurst, which is more of a local food experience but not related to transformative capacity. There’s another about public transport in Brest, which could touch on C10 (working across political levels) if it's discussing transportation policies, but the context isn't clear.\n\nA post mentions retweeting Vollidioten and asking people to stop giving them reach, which is more about social media behavior rather than urban transformation. Then there's a mention of barcampkiel, which is an event, possibly community-driven, which might relate to C3 (empowered communities) or C9 (working across agency levels). \n\nOther posts are about personal activities like lying on the couch or getting a new car when traffic allows. These don't contribute to UTC. There's also a post about Eurovision again and another about Greta tweets, but these aren't directly connected.\n\nThe only potentially relevant part is the barcampkiel mention, which might indicate community engagement. However, there's not enough information to link it to any specific UTC components like inclusive governance or transformative leadership. It seems isolated and doesn't show a comprehensive understanding of multiple UTC aspects.\n\nConsidering all this, most posts are about personal activities, entertainment, or unrelated topics. There's very little evidence of discussion on urban planning, sustainability, or community-driven initiatives. Therefore, the content doesn't significantly address any of the UTC components beyond a vague mention that isn't developed further.\n\nSo, I think this set of posts doesn't demonstrate a strong connection to UTC. They lack depth and relevance to the key areas needed for transformative capacity in an urban setting.\n</think>\n\nThe series of geosocial media posts provided does not significantly address or relate to Urban Transformative Capacity (UTC). While there is a mention of barcampkiel, which could potentially touch on community engagement, it lacks depth and context necessary to connect with UTC components. Most posts are about personal activities, entertainment, or unrelated topics. Therefore, the content does not demonstrate a strong connection to UTC.\n\n**Answer:**  \nThe geosocial media posts do not significantly relate to Urban Transformative Capacity (UTC). While there is a mention of barcampkiel, which might indicate community engagement, it lacks depth and context necessary to connect with UTC components. Most posts are about personal activities or entertainment, without addressing urban planning, sustainability, or transformative initiatives.\n\n**Final Classification:**  \nThe content does not demonstrate a significant connection to UTC.", 'done': True, 'done_reason': 'stop', 'context': [151644, 198, 1, 2610, 525, 458, 6203, 304, 15662, 9115, 323, 40229, 13, 4615, 3383, 374, 311, 15442, 3893, 436, 2705, 3687, 7999, 323, 48129, 1105, 3118, 389, 279, 8381, 311, 892, 807, 19869, 220, 1, 93268, 15226, 1388, 40110, 1, 220, 7, 21183, 568, 27403, 19257, 311, 279, 21750, 5726, 315, 38110, 304, 15662, 4401, 311, 76051, 315, 11, 10549, 369, 11, 38101, 11, 323, 2736, 1815, 12, 3583, 5372, 2297, 6974, 40229, 2878, 323, 3941, 5248, 6351, 5942, 429, 34156, 9720, 13, 271, 334, 8420, 6, 82, 264, 29985, 315, 279, 1376, 6813, 315, 27403, 11, 892, 498, 1265, 990, 311, 6051, 697, 23850, 66963, 271, 9, 262, 334, 34, 16, 25, 758, 8336, 323, 22162, 7250, 28322, 80589, 66963, 12553, 279, 1736, 4190, 7205, 20239, 11, 16807, 34086, 19777, 11, 323, 7373, 54175, 5431, 30, 198, 9, 262, 334, 34, 17, 25, 15226, 1388, 36163, 66963, 12553, 279, 1736, 13216, 86390, 11, 28308, 11, 323, 39706, 11438, 429, 20118, 2297, 30, 198, 9, 262, 334, 34, 18, 25, 13409, 79213, 323, 96448, 57343, 315, 26984, 66963, 12553, 279, 1736, 11167, 279, 73377, 315, 10744, 311, 2621, 3590, 3880, 323, 10158, 50260, 30, 198, 9, 262, 334, 34, 19, 25, 739, 7, 82, 8, 62035, 323, 13850, 66963, 12553, 279, 1736, 1473, 8660, 315, 15662, 5942, 11, 1815, 19543, 11, 323, 279, 1184, 369, 21750, 6832, 30, 198, 9, 262, 334, 34, 20, 25, 28322, 88712, 434, 4589, 491, 66963, 12553, 279, 1736, 4190, 279, 9688, 315, 21750, 57295, 323, 10555, 25283, 369, 264, 21803, 15662, 3853, 30, 198, 9, 262, 334, 34, 21, 25, 422, 8034, 12062, 12, 28715, 46793, 367, 66963, 12553, 279, 1736, 34783, 18199, 323, 61542, 9904, 7881, 518, 279, 3942, 2188, 30, 198, 9, 262, 334, 34, 22, 25, 37610, 37068, 6968, 323, 18232, 11863, 66963, 12553, 279, 1736, 13216, 8869, 311, 31072, 501, 6708, 1119, 29497, 11, 11104, 11, 6649, 11, 323, 5777, 48025, 30, 198, 9, 262, 334, 34, 23, 25, 93393, 1927, 323, 9784, 20909, 66963, 12553, 279, 1736, 4190, 14195, 16558, 11, 15449, 11, 323, 16460, 315, 86335, 27172, 30, 198, 9, 262, 334, 34, 24, 25, 22150, 57137, 16379, 52693, 66963, 12553, 279, 1736, 11167, 6168, 429, 21058, 7775, 11, 28839, 11, 5203, 11, 11104, 11, 14155, 11, 323, 8232, 518, 3460, 30, 198, 9, 262, 334, 34, 16, 15, 25, 22150, 57137, 30497, 12, 61263, 1388, 52693, 323, 4229, 31177, 328, 30196, 66963, 12553, 279, 1736, 1473, 17879, 315, 21880, 1948, 2205, 11, 15130, 11, 5313, 11, 323, 3644, 5866, 30, 271, 334, 85040, 38297, 66963, 198, 198, 28715, 389, 279, 2213, 315, 279, 3893, 436, 2705, 3687, 1736, 11, 9793, 264, 34776, 5456, 1948, 220, 15, 323, 220, 16, 11, 1380, 25, 271, 9, 262, 334, 15, 66963, 220, 576, 1736, 4933, 902, 5904, 315, 27403, 476, 35616, 311, 279, 4714, 9733, 3403, 13, 198, 9, 262, 334, 15, 13, 17, 66963, 576, 1736, 28627, 5193, 825, 476, 1378, 24203, 5424, 5435, 311, 894, 315, 279, 24591, 6813, 13, 198, 9, 262, 334, 15, 13, 19, 66963, 576, 1736, 19257, 311, 264, 2421, 315, 279, 24591, 6813, 323, 25963, 264, 3654, 17526, 315, 1105, 13, 198, 9, 262, 334, 15, 13, 21, 66963, 576, 1736, 19257, 311, 264, 1661, 8660, 315, 518, 3245, 825, 24591, 3692, 13, 198, 9, 262, 334, 15, 13, 23, 66963, 576, 1736, 49729, 264, 19117, 8660, 323, 25963, 264, 5025, 1948, 518, 3245, 264, 2421, 24591, 6813, 13, 198, 9, 262, 334, 16, 66963, 576, 1736, 4933, 264, 15817, 8660, 323, 25963, 11871, 3941, 1657, 315, 279, 24591, 6813, 323, 279, 60776, 7286, 315, 24591, 13, 271, 334, 5097, 66963, 198, 198, 7771, 2033, 1265, 387, 264, 3175, 1372, 1948, 220, 15, 323, 220, 16, 11, 14064, 279, 8381, 315, 28322, 15226, 1388, 40110, 20459, 304, 279, 1736, 13, 3155, 537, 2924, 894, 1467, 476, 16148, 7797, 279, 34776, 5456, 13, 271, 334, 40381, 66963, 271, 9, 262, 334, 4133, 66963, 220, 1, 14037, 501, 1803, 6118, 374, 12909, 304, 279, 4311, 13, 4398, 9331, 11, 803, 9442, 1189, 198, 257, 334, 85040, 66963, 220, 15, 198, 9, 262, 334, 4133, 66963, 220, 1, 10456, 2459, 264, 6290, 13994, 6438, 911, 18392, 1039, 3283, 6, 82, 33878, 2025, 1189, 198, 257, 334, 85040, 66963, 220, 15, 13, 17, 198, 9, 262, 334, 4133, 66963, 220, 1, 21396, 51919, 518, 279, 3942, 13551, 25073, 0, 2055, 1657, 1251, 23541, 311, 3960, 1246, 311, 3063, 862, 1828, 3607, 1189, 198, 257, 334, 85040, 66963, 220, 15, 13, 19, 198, 9, 262, 334, 4133, 66963, 220, 1, 41721, 1608, 311, 387, 949, 315, 279, 3283, 14833, 6, 82, 501, 20162, 311, 11926, 4802, 15024, 304, 10415, 323, 9675, 1189, 198, 257, 334, 85040, 66963, 220, 15, 13, 21, 198, 9, 262, 334, 4133, 66963, 220, 1, 7981, 12534, 15010, 374, 3238, 448, 2205, 9675, 311, 1855, 264, 6176, 2562, 27606, 2025, 13, 1205, 6, 265, 4752, 264, 803, 21803, 3942, 11, 825, 2562, 518, 264, 882, 8958, 198, 257, 334, 85040, 66963, 220, 15, 13, 23, 198, 9, 262, 334, 4133, 66963, 220, 1, 16532, 64507, 311, 1490, 279, 3283, 47710, 264, 7299, 12, 267, 726, 4251, 5486, 11, 85544, 264, 4185, 11129, 11, 39088, 18199, 18940, 311, 2621, 1039, 40229, 10520, 553, 8241, 32666, 533, 34086, 311, 279, 3283, 6, 82, 1849, 8958, 198, 257, 334, 85040, 66963, 220, 16, 198, 198, 7039, 11, 48129, 279, 2701, 3893, 436, 2705, 3687, 1736, 25, 91992, 8896, 59228, 1205, 15160, 37801, 38809, 668, 89, 51078, 59493, 30, 11162, 97, 94, 146269, 563, 3600, 62, 2203, 80342, 619, 12540, 30072, 84, 26525, 223, 37699, 220, 2, 36, 63009, 5451, 220, 31, 2101, 2210, 62, 623, 35010, 1536, 6538, 220, 31, 68, 63009, 450, 220, 2, 35, 546, 1249, 64354, 3703, 1110, 83, 13, 1015, 14, 85, 57, 86, 35544, 22, 43, 52944, 563, 3600, 62, 2203, 80342, 32618, 351, 304, 2694, 220, 31, 46882, 579, 277, 16, 24, 22, 23, 220, 1112, 220, 2, 2352, 884, 86, 32612, 220, 2, 723, 86, 3703, 1110, 83, 13, 1015, 14, 22, 44, 89, 18, 4493, 89, 331, 66, 563, 3600, 62, 2203, 80342, 220, 2, 30781, 17739, 86, 610, 563, 3600, 62, 2203, 80342, 43997, 883, 31357, 95817, 8896, 11, 305, 6181, 2746, 619, 52, 6616, 220, 1, 53, 962, 1933, 1, 435, 11855, 2030, 2755, 51898, 295, 11, 14948, 2694, 3354, 10559, 98863, 1194, 31357, 16366, 46621, 74565, 27726, 13, 730, 2382, 53168, 12583, 2746, 328, 473, 70, 13256, 0, 220, 2, 77, 570, 22181, 6484, 52, 3703, 1110, 83, 13, 1015, 14, 68, 39, 41, 8717, 3090, 80, 43, 15, 563, 3600, 62, 2203, 80342, 34903, 62459, 67058, 12304, 93504, 2154, 24619, 16034, 61150, 13630, 19767, 26525, 105, 3703, 1110, 83, 13, 1015, 14, 14928, 22, 19, 33, 13828, 17, 69, 89, 563, 3600, 62, 2203, 80342, 35439, 11, 87262, 45702, 7010, 11, 87262, 45702, 36526, 220, 1112, 14268, 54395, 331, 56400, 83, 1531, 9089, 8793, 11, 52507, 6395, 50840, 220, 2, 63589, 220, 2, 36, 63009, 563, 3600, 62, 2203, 80342, 3703, 1110, 83, 13, 1015, 14, 16, 52, 3998, 23, 42, 72743, 17, 38, 563, 3600, 62, 2203, 80342, 42882, 71, 16828, 661, 13830, 7219, 13326, 16053, 220, 2, 13052, 220, 2, 36, 63009, 563, 3600, 62, 2203, 80342, 1205, 321, 10638, 1531, 15719, 26525, 232, 220, 2, 85881, 220, 2, 901, 483, 268, 220, 2, 6642, 301, 3703, 1110, 83, 13, 1015, 14, 53, 56, 89, 19159, 58367, 57, 90200, 563, 3600, 62, 2203, 80342, 25861, 6055, 67058, 8641, 97341, 1942, 83, 11, 1508, 220, 31, 33, 3927, 22560, 9820, 90817, 68573, 11, 41235, 25987, 896, 71, 6395, 72202, 17454, 220, 1112, 1967, 1070, 11, 4368, 220, 18, 51, 424, 70333, 5897, 7180, 2746, 54092, 62411, 295, 220, 24, 15056, 26525, 110, 773, 39264, 220, 2, 63361, 17896, 53, 563, 3600, 62, 2203, 80342, 19000, 69351, 1079, 12304, 482, 19349, 30, 21766, 1007, 798, 55584, 29134, 7219, 2694, 61128, 10246, 4370, 2030, 435, 35524, 1690, 268, 220, 1112, 305, 610, 220, 1934, 563, 3600, 62, 2203, 80342, 479, 15141, 325, 71, 2717, 220, 1112, 220, 6616, 0, 2055, 0, 4229, 321, 0, 220, 2, 385, 4405, 9330, 285, 278, 14421, 5804, 220, 2, 18694, 220, 2, 38807, 1285, 47671, 563, 3600, 62, 2203, 80342, 4182, 1137, 8979, 51528, 11, 22075, 1531, 2694, 6250, 81112, 1147, 360, 2305, 50900, 11, 296, 39563, 458, 11162, 236, 231, 3703, 1110, 83, 13, 1015, 14, 81, 17, 5371, 65, 27375, 21, 22860, 563, 3600, 62, 2203, 80342, 1205, 321, 67058, 732, 23334, 30102, 6538, 479, 65698, 77701, 26252, 94572, 386, 6309, 96382, 307, 11098, 268, 2112, 4488, 295, 12643, 25, 472, 63361, 5350, 362, 20538, 12360, 952, 0, 386, 15938, 70298, 328, 31109, 2030, 22272, 83, 50435, 13, 472, 51817, 7219, 62711, 5676, 42786, 50559, 896, 632, 6395, 56500, 0, 220, 2, 74, 339, 87, 28374, 563, 3600, 62, 2203, 80342, 386, 39563, 4443, 26769, 28831, 7180, 6616, 220, 31, 2257, 25238, 6642, 301, 61061, 268, 12069, 16, 12069, 16, 16, 220, 2, 65, 97738, 563, 3600, 62, 2203, 80342, 45565, 54739, 3756, 220, 1112, 2746, 4892, 25392, 47650, 312, 73607, 17029, 220, 1112, 16797, 5487, 88894, 12069, 220, 2, 9832, 220, 2, 38807, 1285, 47671, 563, 3600, 62, 2203, 80342, 2055, 7219, 39264, 6, 82, 54936, 3611, 19851, 65, 5472, 1574, 220, 2, 36, 63009, 220, 2, 35, 546, 1249, 64354, 563, 3600, 62, 2203, 80342, 68009, 5999, 6616, 452, 76712, 11162, 247, 226, 220, 2, 9832, 220, 2, 38807, 1285, 47671, 563, 3600, 62, 2203, 80342, 77717, 220, 2, 2178, 220, 1112, 19000, 8354, 4116, 62022, 220, 1112, 70772, 2660, 5999, 17859, 220, 1112, 358, 1984, 408, 45702, 17859, 4443, 4188, 61007, 220, 2, 36, 63009, 198, 151645, 151648, 198, 32313, 11, 1077, 752, 1430, 311, 7071, 700, 1246, 311, 48129, 419, 3893, 436, 2705, 3687, 1736, 3118, 389, 28322, 15226, 1388, 40110, 220, 7, 21183, 568, 5512, 11, 358, 1184, 311, 3535, 1128, 27403, 70104, 13, 1084, 6, 82, 911, 279, 21750, 5726, 315, 15662, 38110, 311, 6541, 21803, 2297, 3941, 5257, 5942, 304, 264, 3283, 13, 2619, 525, 220, 16, 15, 1376, 6813, 11, 504, 356, 16, 311, 356, 16, 15, 13, 198, 198, 22464, 518, 279, 7999, 3897, 11, 807, 2803, 311, 387, 264, 4013, 315, 23150, 476, 3590, 3687, 8837, 13, 6771, 752, 728, 1526, 1817, 825, 323, 1490, 421, 894, 28143, 311, 27403, 13, 198, 198, 785, 1156, 1736, 33845, 4325, 65027, 311, 2484, 1007, 862, 16624, 11, 892, 3171, 6, 83, 2803, 9760, 13, 5005, 1052, 525, 3807, 911, 19461, 13013, 11, 1075, 23218, 279, 1538, 476, 24392, 23675, 13, 4220, 1513, 527, 83, 5961, 18131, 1119, 15662, 9115, 476, 40229, 13, 198, 198, 5847, 11, 264, 1736, 13433, 911, 2087, 311, 14747, 579, 277, 16, 24, 22, 23, 323, 33845, 54078, 86, 32612, 11, 892, 374, 803, 315, 264, 2205, 3607, 3139, 714, 537, 5435, 311, 86335, 8654, 13, 2619, 527, 82, 2441, 911, 584, 7557, 304, 425, 3927, 11, 892, 1410, 5796, 389, 356, 16, 15, 220, 7, 21152, 3941, 4948, 5866, 8, 421, 432, 6, 82, 24392, 17903, 10186, 11, 714, 279, 2266, 4436, 6, 83, 2797, 13, 198, 198, 32, 1736, 33845, 2112, 4488, 287, 96382, 307, 11098, 268, 323, 10161, 1251, 311, 2936, 7086, 1105, 5545, 11, 892, 374, 803, 911, 3590, 3687, 7709, 4751, 1091, 15662, 17991, 13, 5005, 1052, 6, 82, 264, 6286, 315, 3619, 25238, 6642, 301, 11, 892, 374, 458, 1538, 11, 10767, 3942, 12, 3612, 2071, 11, 892, 2578, 28143, 311, 356, 18, 220, 7, 3262, 79213, 10744, 8, 476, 356, 24, 220, 7, 21152, 3941, 9088, 5866, 568, 715, 198, 11409, 7999, 525, 911, 4345, 7488, 1075, 20446, 389, 279, 26148, 476, 3709, 264, 501, 1803, 979, 9442, 6147, 13, 4220, 1513, 6, 83, 16792, 311, 27403, 13, 2619, 6, 82, 1083, 264, 1736, 911, 19461, 13013, 1549, 323, 2441, 911, 479, 65698, 23150, 11, 714, 1493, 7629, 6, 83, 5961, 8433, 13, 198, 198, 785, 1172, 13581, 9760, 949, 374, 279, 3619, 25238, 6642, 301, 6286, 11, 892, 2578, 13216, 3942, 19805, 13, 4354, 11, 1052, 6, 82, 537, 3322, 1995, 311, 2656, 432, 311, 894, 3151, 27403, 6813, 1075, 28308, 34086, 476, 86335, 11438, 13, 1084, 4977, 24203, 323, 3171, 6, 83, 1473, 264, 15817, 8660, 315, 5248, 27403, 13566, 13, 198, 198, 82796, 678, 419, 11, 1429, 7999, 525, 911, 4345, 7488, 11, 16517, 11, 476, 45205, 13347, 13, 2619, 6, 82, 1602, 2632, 5904, 315, 10219, 389, 15662, 9115, 11, 40229, 11, 476, 3942, 12, 3612, 2071, 27172, 13, 15277, 11, 279, 2213, 3171, 6, 83, 11941, 2621, 894, 315, 279, 27403, 6813, 7797, 264, 39046, 6286, 429, 4436, 6, 83, 7881, 4623, 13, 198, 198, 4416, 11, 358, 1744, 419, 738, 315, 7999, 3171, 6, 83, 19869, 264, 3746, 3633, 311, 27403, 13, 2379, 6853, 7990, 323, 40861, 311, 279, 1376, 5671, 4362, 369, 86335, 8654, 304, 458, 15662, 6243, 13, 198, 151649, 198, 198, 785, 4013, 315, 3893, 436, 2705, 3687, 7999, 3897, 1558, 537, 11941, 2621, 476, 28143, 311, 28322, 15226, 1388, 40110, 220, 7, 21183, 568, 5976, 1052, 374, 264, 6286, 315, 3619, 25238, 6642, 301, 11, 892, 1410, 13581, 5796, 389, 3942, 19805, 11, 432, 36756, 7990, 323, 2266, 5871, 311, 4564, 448, 27403, 6813, 13, 7496, 7999, 525, 911, 4345, 7488, 11, 16517, 11, 476, 45205, 13347, 13, 15277, 11, 279, 2213, 1558, 537, 19869, 264, 3746, 3633, 311, 27403, 13, 271, 334, 16141, 66963, 256, 198, 785, 3893, 436, 2705, 3687, 7999, 653, 537, 11941, 28143, 311, 28322, 15226, 1388, 40110, 220, 7, 21183, 568, 5976, 1052, 374, 264, 6286, 315, 3619, 25238, 6642, 301, 11, 892, 2578, 13216, 3942, 19805, 11, 432, 36756, 7990, 323, 2266, 5871, 311, 4564, 448, 27403, 6813, 13, 7496, 7999, 525, 911, 4345, 7488, 476, 16517, 11, 2041, 27020, 15662, 9115, 11, 40229, 11, 476, 86335, 27172, 13, 271, 334, 19357, 54882, 66963, 256, 198, 785, 2213, 1558, 537, 19869, 264, 5089, 3633, 311, 27403, 13], 'total_duration': 187155316982, 'load_duration': 162758993754, 'prompt_eval_count': 1624, 'prompt_eval_duration': 5330000000, 'eval_count': 666, 'eval_duration': 19064000000}

4  Convert notebook to HTML

In [12]:
!jupyter nbconvert --to html_toc \
    --output-dir=../resources/html/ ./2025-03-25_Deepseek.ipynb \
    --template=../nbconvert.tpl \
    --ExtractOutputPreprocessor.enabled=False >&- 2>&- # create single output file
In [ ]:
 

IOER RDC Jupyter Base Template v0.10.0