You can see a figure of speech right off at the very beginning of the poem. The poem starts with an apostrophe, which is when a speaker in a work of literature addresses some concept or idea as if it were a physical thing that is present. Wordsworth starts the poem by speaking directly to duty. In fact, the whole poem really is one big apostrophe because he is addressing duty throughout.
While addressing duty, Wordsworth uses personification as well. He refers to duty as a stern lawgiver and as the daughter of the voice of God. He also has duty do a number of things, as if duty were an animate being.
Wordsworth also uses metaphor. For example, in the first stanza, he says that is a light to guide and a rod to punish the people who are doing wrong.