There qutie a fiew ways to get the sematic model.
From a Document class
Document document = ...;
SemanticModel semanticModel = await document.GetSemanticModelAsync();
From a Compilationclass
CSharpCompilation compilation = ...;
var semanticModel = await compilation.GetSemanticModel...