<｜begin▁of▁sentence｜>### Instruction:
Absolutely, let's imagine you're working on organizing a new digital collection on ecosystem modeling here at the library. You've come across a fascinating conceptual model that represents the transfer of energy within an ecosystem through a series of documents. This model can be visualized as a directed chain of interactions starting from a basal species and moving up to the top predator, corresponding to a sequence like 0 → 1 → 2 → 3 → 4 in our digital records.

Now, you're looking to enrich the metadata of these digital documents with a more detailed analysis of the model. Specifically, you're interested in determining the "trophic level" of each species in this food web—a numerical value that represents each species' position in the flow of energy.

Could you take the interaction data we have, these pairs of numbers representing directed interactions between species (which you might think of as 'links' between documents), and use the computational tool NetworkX to calculate the trophic level for each species? This would add a valuable layer of information to our digital catalog, assisting researchers in quickly understanding the hierarchy within this ecosystem. 

Just to clarify, the interactions in your model are represented by the following pairs: (0, 1), (1, 2), (2, 3), (3, 4). Integrating the trophic levels into our system would be a splendid enhancement to the data we offer to our patrons.
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()
G.add_weighted_edges_from([(0, 1), (1, 2), (2, 3), (3, 4)])

# Compute the trophic levels of the nodes
levels = nx.trophic_levels(G)
print('Trophic levels:', levels)
<|EOT|>
