With the introduction of LLMSynthesize in version 13.3, it became very easy to generate topical essays on just about any subject. The Large Language Model (LLM) uses its internal knowledge to generate text that relates to the topic requested. For example, here is an example for the city of Amsterdam in the Netherlands:
LLMSynthesize["Write a short essay about Amsterdam"]
Amsterdam, the capital of the Netherlands, is a city renowned for its rich cultural heritage, intricate canal systems, and vibrant atmosphere. Founded in the late 12th century as a small fishing village on the banks of the Amstel River, Amsterdam has grown into a bustling metropolis that attracts millions of tourists each year.
One of the most distinctive features of Amsterdam is its network of canals, which earned it the moniker "Venice of the North." These canals, over 100 kilometers in total, were primarily constructed during the Dutch Golden Age of the 17th century to facilitate trade and drainage. Today, they form a UNESCO World Heritage site, offering scenic beauty and a unique perspective of the city through picturesque boat tours. Alongside these waterways stand the city's iconic narrow houses with gabled facades, epitomizing Amsterdam's architectural charm.
Culturally, Amsterdam is a hub of artistic expression and historical significance. It is home to world-class museums, including the Van Gogh Museum, which houses the largest collection of Vincent van Gogh's works, and the Rijksmuseum, where masterpieces from the likes of Rembrandt and Vermeer can be admired. The Anne Frank House stands as a poignant reminder of the city’s more tumultuous history during World War II, providing insight into the Jewish wartime experience.
Amsterdam is also renowned for its progressive social policies and liberal attitudes. The city has long been at the forefront of embracing diversity and championing individual freedoms. This is evident in its thriving LGBTQ+ community and the widespread acceptance of varying lifestyles. Such openness is further reflected in its coffee shops and the regulated yet tolerant stance on cannabis.
The city's vibrant culture is complemented by its dynamic and cosmopolitan populace. Amsterdam is home to a diverse community, with people from around the world contributing to its multicultural fabric. This diversity extends to its cuisine, offering an array of international dishes alongside traditional Dutch fare. The city is famous for its bustling markets, such as the Albert Cuyp Market, where one can sample Dutch delicacies like stroopwafels and herring.
Transportation in Amsterdam is particularly notable for its cycling infrastructure. With its flat terrain and numerous bike paths, the city is a cyclist's paradise. Bicycles are an integral part of daily life, often outnumbering cars and serving as a primary mode of transportation for locals and visitors alike.
In conclusion, Amsterdam is a city that seamlessly blends history with modernity, tradition with progressiveness, and tranquility with vibrancy. Its canals and architecture invite exploration and admiration, while its cultural institutions offer deep dives into art and history. A city of open minds and open hearts, Amsterdam continues to captivate with its unique charm, inviting all who visit to immerse themselves in its multifaceted allure.
One of the most distinctive features of Amsterdam is its network of canals, which earned it the moniker "Venice of the North." These canals, over 100 kilometers in total, were primarily constructed during the Dutch Golden Age of the 17th century to facilitate trade and drainage. Today, they form a UNESCO World Heritage site, offering scenic beauty and a unique perspective of the city through picturesque boat tours. Alongside these waterways stand the city's iconic narrow houses with gabled facades, epitomizing Amsterdam's architectural charm.
Culturally, Amsterdam is a hub of artistic expression and historical significance. It is home to world-class museums, including the Van Gogh Museum, which houses the largest collection of Vincent van Gogh's works, and the Rijksmuseum, where masterpieces from the likes of Rembrandt and Vermeer can be admired. The Anne Frank House stands as a poignant reminder of the city’s more tumultuous history during World War II, providing insight into the Jewish wartime experience.
Amsterdam is also renowned for its progressive social policies and liberal attitudes. The city has long been at the forefront of embracing diversity and championing individual freedoms. This is evident in its thriving LGBTQ+ community and the widespread acceptance of varying lifestyles. Such openness is further reflected in its coffee shops and the regulated yet tolerant stance on cannabis.
The city's vibrant culture is complemented by its dynamic and cosmopolitan populace. Amsterdam is home to a diverse community, with people from around the world contributing to its multicultural fabric. This diversity extends to its cuisine, offering an array of international dishes alongside traditional Dutch fare. The city is famous for its bustling markets, such as the Albert Cuyp Market, where one can sample Dutch delicacies like stroopwafels and herring.
Transportation in Amsterdam is particularly notable for its cycling infrastructure. With its flat terrain and numerous bike paths, the city is a cyclist's paradise. Bicycles are an integral part of daily life, often outnumbering cars and serving as a primary mode of transportation for locals and visitors alike.
In conclusion, Amsterdam is a city that seamlessly blends history with modernity, tradition with progressiveness, and tranquility with vibrancy. Its canals and architecture invite exploration and admiration, while its cultural institutions offer deep dives into art and history. A city of open minds and open hearts, Amsterdam continues to captivate with its unique charm, inviting all who visit to immerse themselves in its multifaceted allure.
One drawback or limitation of LLMs is that they have a fixed amount of knowledge about any subject, so running LLMSynthesize repeatedly will only generate variations of its internal knowledge. To improve upon this, you can additional facts and context in your LLMSynthesize prompt. In this notebook I am using the WikidataData function to collect more facts, including facts that may change on a regular basis, like the mayor of a city. To start off, I created a helper function called FactifyEntity which processes the information given by WikidataData for a certain entity into a structured piece of text. Here is the function:
In[]:=
FactifyEntity[entity_Entity]:=Module{list},list={};ScanFunction[{v},AppendTo[list,First[v]<>"\n"];Map[AppendTo[list,"* "<>#<>"\n"]&,Last[v]];],CasesDeleteCasesNormal[WikidataData[entity,"Association"]]/.e_ExternalIdentifier:>e["Label"],e_URL:>First[e],e_DateObject:>DateString[e],e_Quantity:>[e],e_GeoPosition:>ToString[e],e_Real:>ToString[e],e_Integer:>ToString[e]/.{_Missing:>Nothing},HoldPattern[_->{}],HoldPattern[_String->_List];StringJoin[list]
If you run this function on an entity, like Amsterdam, it will generate a string with various extra facts than can be useful to an LLM to generate more pertinent results:
In[]:=
FactifyEntity
Out[]=
Label* AmsterdamDescription* capital and most populous city of the NetherlandsAlternativeLabels* Amsterdam, North Holland* Amsterdam, Netherlands* A'dam* Amsterdam, NL* Mokumpostal code* 1100–1109* 1000–1098head of government* Femke Halsemacountry* Netherlandspart of* AmstellandCommons category* Amsterdamimage* http://commons.wikimedia.org/wiki/Special:FilePath/Amsterdam%20airphoto.jpglocated in time zone* UTC+01:00* Central European Time* UTC+02:00inception* 1300member of* C40 Cities Climate Leadership Group* World Tourism Cities Federation* International Cities of Refuge Network* League of Historical Citieslocal dialing code* 20located in the administrative territorial entity* Amsterdaminstance of* national capital* port settlement* cycling city* place with town rights and privileges* big city* cadastral populated place in the Netherlands* city* largest citycontinent* Europeflag image* http://commons.wikimedia.org/wiki/Special:FilePath/Flag%20of%20Amsterdam.svgcoat of arms image* http://commons.wikimedia.org/wiki/Special:FilePath/Wapen%20van%20Amsterdam.svgcoordinate location* GeoPosition[{52.3667, 4.88333}]significant event* 1928 Summer Olympics* siege* city fire* Blockades of Amsterdamaward received* European City of the Treesnamed after* Amstellogo image* http://commons.wikimedia.org/wiki/Special:FilePath/Logo%20of%20Gemeente%20Amsterdam.svgflag* flag of Amsterdamofficial website* https://amsterdam.nltopic's main category* Category:Amsterdamtwinned administrative body* Rio de Janeiro* Beira* Willemstad* Riga* Algiers* Ramallah* Cali* Sarajevo* Montreal* Nicosia* Kyiv* Recife* Jakarta* Athens* Manchester* London* Istanbul* Brasília* Moscow* Bogotá* Varna* Managua* Beijinglocated in or next to body of water* IJmeer* IJ* Amstelcoat of arms* coat of arms of Amsterdamlocator map image* http://commons.wikimedia.org/wiki/Special:FilePath/Amsterdam%20location%20map.svgspoken text audio* http://commons.wikimedia.org/wiki/Special:FilePath/Nl-Amsterdam-article.oggCommons gallery* Amsterdampage banner* http://commons.wikimedia.org/wiki/Special:FilePath/Amsterdam%20Canal%20Banner.jpgtime of earliest written record* 1275population* 921468.office held by head of government* mayor of Amsterdamrelated category* Category:Amsterdam-related listscategory for maps* Category:Maps of Amsterdamcategory for the view of the item* Category:Views of Amsterdamnickname* Venice of the northlist of monuments* list of monuments in Amsterdam* list of war memorials in Amsterdamcategory for people born here* Category:Births in Amsterdamopen data portal* Data and information Amsterdamaerial view* http://commons.wikimedia.org/wiki/Special:FilePath/Imagen%20de%20los%20canales%20conc%C3%A9ntricos%20en%20%C3%81msterdam.pngdescribed by source* The New Student's Reference Work* Armenian Soviet Encyclopedia, vol. 1* Meyer’s Universum, Erster Band* The Nuttall Encyclopædia* Encyclopædia Britannica 11th edition* Catholic Encyclopedia* Brockhaus and Efron Encyclopedic Dictionary* Vlastenský slovník historický* Jewish Encyclopedia of Brockhaus and Efron* Great Soviet Encyclopedia (1926–1947)* Small Brockhaus and Efron Encyclopedic Dictionary* Sytin Military Encyclopedia* Encyclopedic Lexicon* Topographia Circuli Burgundicicapital of* Kingdom of the Netherlandsdetail map* http://commons.wikimedia.org/wiki/Special:FilePath/Amsterdam-topografie.jpgsocial media followers* 424396.economy of topic* economy of Amsterdamcategory for people who died here* Category:Deaths in Amsterdammotto* Heldhaftig, Vastberaden, Barmhartigdemonym* Amsterdamercategory for films shot at this location* Category:Films shot in Amsterdamplace name sign* http://commons.wikimedia.org/wiki/Special:FilePath/Amsterdam%20%28town%20sign%29.jpgWordLift URL* http://data.thenextweb.com/tnw/entity/amsterdam_2* http://data.wordlift.io/wl01254/entity/amsterdamon focus list of Wikimedia project* Genadendal Music Archive* Wikipedia:List of articles all languages should have* Wikipedia:Vital articles/Level/4category for people buried here* Category:Burials in Amsterdam by placecategory of associated people* Category:People from Amsterdamdifferent from* Amsterdamelevation above sea level* -2 marea* 219 2 kmhistory of topic* history of Amsterdamhashtag* Amsterdamgeography of topic* geography of Amsterdamhas part(s) of the class* bridge* canalvisitor center* Stichting Amsterdam Marketingwater as percent of area* 24.23 %nighttime view* http://commons.wikimedia.org/wiki/Special:FilePath/Amsterdam%20Grachten%20at%20night.jpg
Using this extra set of facts, we can now call LLMSynthesize with a long prompt that includes all this extra information. This is done with a function I named FactEnhancedSynthesize. This function simply generates the more comprehensive prompt and then calls LLMSynthesize on that prompt:
We can now generate an essay similar to the one above, but note how the output now includes some facts from the WikidataData information leading to a richer and more fact-inclusive result:
Nestled in the heart of Europe, Amsterdam stands as a testament to human resilience, creativity, and innovation. The capital and most populous city of the Netherlands, Amsterdam is not just a geographical label, but a living tapestry of history, culture, and modernity, earning its nickname as the "Venice of the North." With an official population of over 921,000, Amsterdam serves as a hub of cultural diversity and communal harmony, inviting millions of visitors each year to partake in its singular charm.
Founded in 1300 and deriving its name from the river Amstel, Amsterdam has unfurled its narrative through the annals of time, positioning itself as a city of strategic importance and historical weight. The Amstel river itself is central to Amsterdam’s identity, cutting through the city and delineating its development from a modest fishing village into a bustling port settlement. Today, the city retains the mark of its mercantile past, with an intricate network of canals encircling its core—a UNESCO World Heritage site since 2010—reflecting the ingenuity of its engineered landscape.
The landscape of Amsterdam is strikingly defined by its waterways, bridges, and narrow, gabled houses that align with its 17th-century Golden Age aesthetics. Yet, beyond its picturesque facades, Amsterdam is a city deeply committed to modern environmental consciousness. It is a proud member of the C40 Cities Climate Leadership Group, illustrating its dedication to global environmental initiatives. The city's ethos of sustainability is evident in its infrastructure, where cycling reigns supreme as a primary mode of transport, reducing the city's carbon footprint and enhancing the quality of urban life.
Amsterdam's architectural splendor is matched by its rich tapestry of cultural offerings. It is home to an array of world-class museums, including the Van Gogh Museum, the Rijksmuseum, and the Anne Frank House, each telling stories that are captivating and historically important. These cultural institutions not only house priceless works of art and historical artifacts but also offer insightful perspectives into human creativity and resilience.
The spirit of diversity and inclusiveness permeates Amsterdam’s social fabric. Its multicultural demographic is a testament to generations of trade, migration, and openness, contributing to a vibrant culinary scene, a dynamic arts landscape, and a thriving economy. The city’s inclusivity is echoed in its motto, "Heldhaftig, Vastberaden, Barmhartig" (Valiant, Determined, Compassionate), reflecting values that have guided its evolution over centuries.
While Amsterdam is steeped in history, it is equally forward-thinking. As the current mayor of Amsterdam, Femke Halsema leads with a vision of progress, prioritizing sustainable urban development and social equality. The city is a nexus for innovation and entrepreneurship, and a key player in the global dialogue about urban living in the face of climate change and digital transformation.
A distinguishing feature of Amsterdam is its elevation—two meters below sea level—posing unique environmental challenges yet offering opportunities for innovative engineering solutions, such as the robust system of dikes and canals that protect the city from flooding. This pragmatic approach to environmental management underscores the city's broader capacity for resilience and adaptation.
In terms of global influence and camaraderie, Amsterdam has cultivated twinning relationships with numerous cities worldwide, including Rio de Janeiro, Montreal, and Jakarta, fostering exchange and cooperation across cultures and continents. These partnerships enhance Amsterdam’s role as a significant player on the world stage, facilitating educational, cultural, and economic exchanges that benefit the global community.
Amsterdam also prides itself on its vibrant nightlife and energetic festivals, drawing visitors to experience its lively streets and iconic coffee shops. The city offers a nightlife that is as diverse as its menus and museums, from the bustling Dam Square to the stylish clubs along the Rembrandtplein.
Yet, beneath its many layers of history and modernity, Amsterdam remains a city that cherishes simplicity—the gentle lapping of the Amstel River, the quiet solemnity of its historic churches, and the resonant laughter from its eclectic markets. It is a city where the past and present intertwine seamlessly, crafting narratives that continue to inspire and engage all who walk its cobbled streets.
In conclusion, Amsterdam is more than the sum of its historic canals and vibrant culture; it is a dynamic testament to human innovation and resilience. By embracing its unique challenges and leveraging its rich heritage, Amsterdam not only anchors itself as a beacon of history and culture but also as an exemplar of sustainable urban living and global connectivity. This city's spirit, shared with the world, shines through its diversity and determination, making it a remarkable European capital with an enduring global impact.
Founded in 1300 and deriving its name from the river Amstel, Amsterdam has unfurled its narrative through the annals of time, positioning itself as a city of strategic importance and historical weight. The Amstel river itself is central to Amsterdam’s identity, cutting through the city and delineating its development from a modest fishing village into a bustling port settlement. Today, the city retains the mark of its mercantile past, with an intricate network of canals encircling its core—a UNESCO World Heritage site since 2010—reflecting the ingenuity of its engineered landscape.
The landscape of Amsterdam is strikingly defined by its waterways, bridges, and narrow, gabled houses that align with its 17th-century Golden Age aesthetics. Yet, beyond its picturesque facades, Amsterdam is a city deeply committed to modern environmental consciousness. It is a proud member of the C40 Cities Climate Leadership Group, illustrating its dedication to global environmental initiatives. The city's ethos of sustainability is evident in its infrastructure, where cycling reigns supreme as a primary mode of transport, reducing the city's carbon footprint and enhancing the quality of urban life.
Amsterdam's architectural splendor is matched by its rich tapestry of cultural offerings. It is home to an array of world-class museums, including the Van Gogh Museum, the Rijksmuseum, and the Anne Frank House, each telling stories that are captivating and historically important. These cultural institutions not only house priceless works of art and historical artifacts but also offer insightful perspectives into human creativity and resilience.
The spirit of diversity and inclusiveness permeates Amsterdam’s social fabric. Its multicultural demographic is a testament to generations of trade, migration, and openness, contributing to a vibrant culinary scene, a dynamic arts landscape, and a thriving economy. The city’s inclusivity is echoed in its motto, "Heldhaftig, Vastberaden, Barmhartig" (Valiant, Determined, Compassionate), reflecting values that have guided its evolution over centuries.
While Amsterdam is steeped in history, it is equally forward-thinking. As the current mayor of Amsterdam, Femke Halsema leads with a vision of progress, prioritizing sustainable urban development and social equality. The city is a nexus for innovation and entrepreneurship, and a key player in the global dialogue about urban living in the face of climate change and digital transformation.
A distinguishing feature of Amsterdam is its elevation—two meters below sea level—posing unique environmental challenges yet offering opportunities for innovative engineering solutions, such as the robust system of dikes and canals that protect the city from flooding. This pragmatic approach to environmental management underscores the city's broader capacity for resilience and adaptation.
In terms of global influence and camaraderie, Amsterdam has cultivated twinning relationships with numerous cities worldwide, including Rio de Janeiro, Montreal, and Jakarta, fostering exchange and cooperation across cultures and continents. These partnerships enhance Amsterdam’s role as a significant player on the world stage, facilitating educational, cultural, and economic exchanges that benefit the global community.
Amsterdam also prides itself on its vibrant nightlife and energetic festivals, drawing visitors to experience its lively streets and iconic coffee shops. The city offers a nightlife that is as diverse as its menus and museums, from the bustling Dam Square to the stylish clubs along the Rembrandtplein.
Yet, beneath its many layers of history and modernity, Amsterdam remains a city that cherishes simplicity—the gentle lapping of the Amstel River, the quiet solemnity of its historic churches, and the resonant laughter from its eclectic markets. It is a city where the past and present intertwine seamlessly, crafting narratives that continue to inspire and engage all who walk its cobbled streets.
In conclusion, Amsterdam is more than the sum of its historic canals and vibrant culture; it is a dynamic testament to human innovation and resilience. By embracing its unique challenges and leveraging its rich heritage, Amsterdam not only anchors itself as a beacon of history and culture but also as an exemplar of sustainable urban living and global connectivity. This city's spirit, shared with the world, shines through its diversity and determination, making it a remarkable European capital with an enduring global impact.
With this simple enhancement, the quality of the result is improved. There is of course still the possibility that some of the generated WikidataData facts could be misinterpreted by the LLM. With some additional work, the FactifyEntity could also be improved to filter out some of the less important facts. It could also dig deeper into the network of related Wikidata contents by following links to related topics.
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Fact enhanced LLMSynthesize, with WikidataData
by Arnoud Buzing
Wolfram Community, STAFF PICKS, December 13, 2024
https://community.wolfram.com/groups/-/m/t/3338741
by Arnoud Buzing
Wolfram Community, STAFF PICKS, December 13, 2024
https://community.wolfram.com/groups/-/m/t/3338741