Sentient?
The Star Trek ship's computer & Mother would be, under the Revelation Space classification, beta-level intelligences, giving the appearance and responses of a fully sentient consciousness.
IIRC there are two occasions in TNG where the ship's computer becomes fully conscious - can't remember the first one, and the second is toward the end of S7 where a whole new lifeform is born aboard the Enterprise. Generally AI in the Trek universe has been confined to androids (Data) & holograms (various holodeck episodes, the Dr from Voyager) - and indeed V'Ger in ST: The Motion Picture.
Re: The Matrix - what about The Source? The original, human-built AI that appears in the Machine City at the end of Revolutions? Not part of the Matrix, and certainly responsible for a lot of D&D (altho in the Animatrix: The Second Renaissance we see that humanity was pretty much the cause of it's own downfall on that front, treating sentient beings like shit), so I call foul on not including The Source.