• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 15 páginas
Examen

COS4861 Assignment 3 Natural Language Processing Year Module 2026

Document preview thumbnail
Vista previa 2 fuera de 15 páginas

Get a clear, reliable assignment with accurate answers and useful explanations. Choose us to help you stay on track and work towards better results.

Vista previa del contenido

UNIVERSITY OF SOUTH AFRICA
School of Computing, College of Science, Engineering and Technology


⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄


COS4861: Natural Language Processing

Assignment 3 | Semester 2, 2026

⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄⋄




COS4861
Module Code:
Natural Language Processing
Module Name:
ND-RECOGNIZE Search Strategies & Text
Assignment Topic:
Preprocessing Pipeline
3
Assignment Number:
2, 2026
Semester:
Year Module 2026
Due Date:
50
Total Marks:




Submitted in partial fulfilment of the requirements for COS4861, UNISA 2026

, UNISA | COS4861 NLP: ND-RECOGNIZE & Preprocessing Pipeline



Question 1: ND-RECOGNIZE and Non-Deterministic Search Strategies

Chapter 2 of Jurafsky and Martin’s Speech and Language Processing formalises the equiva-
lence between regular expressions and finite-state automata, and shows that a non-deterministic
FSA (NFSA) needs an explicit search procedure, ND-RECOGNIZE, to resolve the multiple tran-
sition choices that determinism would otherwise remove (Jurafsky and Martin, 2024). The
implementation below builds an NFSA for the pattern baa*!, exercises it against the target
string "baaa!", and compares a stack-driven (DFS) agenda against a queue-driven (BFS)
agenda.


1.1 Automaton Representation (5 Marks)


The automaton is represented as a small class, NFSA, wrapping a nested dictionary keyed
first by state and then by input symbol. Each (state, symbol) pair maps to a list of desti-
nation states rather than a single state, which is precisely what makes the automaton non-
deterministic: on symbol a the state q2 can either loop back on itself (to consume another
a, modelling the Kleene star) or, via a separate transition, be reached again after an epsilon
move. Epsilon-moves are stored under the reserved symbol string ’eps’ and consume no
input, which is the second required source of non-determinism.

1 class NFSA :
2 """
3 A Non - deterministic Finite State Automaton .
4

5 transitions : dict mapping
6 state -> { symbol -> [ list of destination states ] }
7 A symbol of ’ eps ’ represents an epsilon - transition ( no input consumed ) .
8 Storing a LIST of destination states per ( state , symbol ) pair is what
9 allows the automaton to be non - deterministic .
10 """
11

12 def __init__ ( self , start_state , accept_states ) :
13 self . start_state = start_state
14 self . accept_states = set ( accept_states )
15 self . transitions = {}
16

17 def add_transition ( self , state , symbol , next_state ) :
18 " " " Registers one edge ; repeated calls with the same ( state , symbol )
19 accumulate a list of destinations , modelling non - determinism . " " "



Page 2 of 15

Libro relacionado
 image
Editorial: 2013 ISBN: 9789380578774 Edición: Desconocido

Información del documento

Subido en
25 de agosto de 2026
Número de páginas
15
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$4.91

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
BeeNotes
4.1
(40)
Vendido
352
Seguidores
0
Artículos
1012
Última venta
1 semana hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes