NLP for CP
Addressing Constraint Programming with Natural Language Processing
Home
Resources
Publications
Correct
predictions are in
blue
. If we detect only a subset of a labelled sentence, we highlight the caught part as
blue
, the missing part
light blue.
False positives
are in
green
and
false negatives
are in
red
.
Problem 036 (Error correcting code) — Constraint detection
A
fixed
length
error
correcting
code
C
of
length
n
over
an
alphabet
F
is
a
set
of
strings
from
Fn
.
Given
two
strings
from
Fn
we
can
define
the
distance
between
them
.
The
most
commonly
used
distance
is
the
Hamming
distance
,
defined
as
the
number
of
positions
where
the
strings
differ
.
Using
this
we
define
the
minimum
distance
of
C
as
the
minimum
of
the
distances
between
distinct
pairs
of
strings
from
C
.
There
are
a
number
of
other
distances
which
can
be
used
,
for
example
the
``
Lee
distance
''
.
When
F
=
-LCB-
0,1
,
-
,
n-1
-RCB-
the
Lee
distance
between
a
,
b
in
F
is
defined
as
min
-LRB-
|
a-b
|
,
n
-
|
a-b
|
-RRB-
.
For
two
vectors
x
and
y
defined
over
Fn
,
the
Lee
distance
is
calculated
by
summing
the
Lee
distance
of
the
pairs
xi
,
yi
.
Most
commonly
F
=
-LCB-
0,1,2,3
-RCB-
as
this
case
proves
useful
in
a
number
of
areas
.
Following
standard
practice
we
represent
the
code
as
an
$
n
\
times
|
C
|
$
matrix
,
where
each
row
contains
one
element
of
the
code
.
The
difference
constraint
is
enforced
between
pairs
of
rows
.
This
Problem 036 (Error correcting code) — Detection of the decisions and objects to be modeled
A
fixed
length
error
correcting
code
C
of
length
n
over
an
alphabet
F
is
a
set
of
strings
from
Fn
.
Given
two
strings
from
Fn
we
can
define
the
distance
between
them
.
The
most
commonly
used
distance
is
the
Hamming
distance
,
defined
as
the
number
of
positions
where
the
strings
differ
.
Using
this
we
define
the
minimum
distance
of
C
as
the
minimum
of
the
distances
between
distinct
pairs
of
strings
from
C
.
There
are
a
number
of
other
distances
which
can
be
used
,
for
example
the
``
Lee
distance
''
.
When
F
=
-LCB-
0,1
,
-
,
n-1
-RCB-
the
Lee
distance
between
a
,
b
in
F
is
defined
as
min
-LRB-
|
a-b
|
,
n
-
|
a-b
|
-RRB-
.
For
two
vectors
x
and
y
defined
over
Fn
,
the
Lee
distance
is
calculated
by
summing
the
Lee
distance
of
the
pairs
xi
,
yi
.
Most
commonly
F
=
-LCB-
0,1,2,3
-RCB-
as
this
case
proves
useful
in
a
number
of
areas
.
Following
standard
practice
we
represent
the
code
as
an
$
n
\
times
|
C
|
$
matrix
,
where
each
row
contains
one
element
of
the
code
.
The
difference
constraint
is
enforced
between
pairs
of
rows
.
This
Back to list