Skip to content

Commit 004abd1

Browse files
committed
Updated to Spacy 3.3.0
1 parent 0b8a6ef commit 004abd1

13 files changed

Lines changed: 52 additions & 53 deletions

regex_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_regex(self, report_filename):
105105
'right' : ""
106106
}
107107
#Add this match result to the data frame
108-
df_utt_result=df_utt_result.append(result,ignore_index=True)
108+
df_utt_result=pd.concat([df_utt_result,pd.DataFrame(result,index=[0])])
109109
if len(matches)==0:
110110
result={
111111
'regex_id':_regex_id,
@@ -118,14 +118,14 @@ def test_regex(self, report_filename):
118118
'matched_text' : "",
119119
'right' : ""
120120
}
121-
df_utt_result=df_utt_result.append(result,ignore_index=True)
121+
df_utt_result=pd.concat([df_utt_result,pd.DataFrame(result,index=[0])])
122122

123123
#Now work out if this utterance passed or failed the test, and add the result to all results for this utterance.
124124
#print (_match_type,_exact_match_count,_partial_match_count,len(_pattern_set))
125125
_phrase_test_pass=self.get_pass_fail(_match_type,_exact_match_count,_partial_match_count,len(_pattern_set))
126126
df_utt_result["test_type"]=str(_match_type)
127127
df_utt_result["pass"]=_phrase_test_pass
128-
df=df.append(df_utt_result)
128+
df=pd.concat([df,df_utt_result])
129129

130130
if (not _phrase_test_pass):
131131
print ("FAIL: regex-id: "+_regex_id +" => '"+str(test_text)+"' "+str(_match_type)+" "+str(_flags))

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
regex==2021.7.6
2-
spacy==3.0.6
3-
pandas==1.1.3
4-
inflect==5.3.0
1+
regex==2022.4.24
2+
spacy==3.3.0
3+
pandas==1.4.2
4+
inflect==5.6.0
55
pyrsistent==0.18.1
66
pyyaml==6.0
77
xeger==0.3.5
8-
9-
8+
https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.3.0/en_core_web_lg-3.3.0.tar.gz#egg=en_core_web_lg
9+
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.3.0/en_core_web_sm-3.3.0.tar.gz#egg=en_core_web_sm

test/regextest.csv

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
,regex_id,test_type,pass,group,ix,match,left,matched_text,right,pattern_ix,test_text
2-
0,pin-text,MatchType.ONE_OR_MORE_MATCH,True,0.0,1.0,exact,,1234,,1.0,1234
3-
0,pin-text,MatchType.ONE_OR_MORE_MATCH,True,0.0,1.0,partial,the pin number is, 1234,.,1.0,the pin number is 1234.
4-
0,pin-text,MatchType.NO_MATCHES,True,0.0,0.0,none,,,,1.0,abc1234de
5-
0,pin-text,MatchType.NO_MATCHES,True,0.0,0.0,none,,,,1.0,1 2 3 4
6-
0,pin-voice,MatchType.ONE_OR_MORE_MATCH,True,0.0,1.0,exact,,one two three four,,1.0,one two three four
7-
0,pin-voice,MatchType.ONE_OR_MORE_MATCH,True,0.0,1.0,partial,the pin number is, one two three four, maiden name is walsh,1.0,the pin number is one two three four maiden name is walsh
1+
,regex_id,test_type,pass,group,ix,match,left,matched_text,right,test_text,pattern_ix
2+
0,pin-text,MatchType.ONE_OR_MORE_MATCH,True,0,1,exact,,1234,,1234,1.0
3+
0,pin-text,MatchType.ONE_OR_MORE_MATCH,True,0,1,partial,the pin number is, 1234,.,the pin number is 1234.,1.0
4+
0,pin-text,MatchType.NO_MATCHES,True,0,0,none,,,,abc1234de,1.0
5+
0,pin-text,MatchType.NO_MATCHES,True,0,0,none,,,,1 2 3 4,1.0
6+
0,pin-voice,MatchType.ONE_OR_MORE_MATCH,True,0,1,exact,,one two three four,,one two three four,1.0
7+
0,pin-voice,MatchType.ONE_OR_MORE_MATCH,True,0,1,partial,the pin number is, one two three four, maiden name is walsh,the pin number is one two three four maiden name is walsh,1.0

test/text_log_l2.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ PIN-13,1168
1414
PERSON-15,David
1515
MONEY-17,500.43
1616
MONEY-18,500
17-
PERSON-19,Dec-23

test/text_log_l3.csv

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ ORDINAL-18,1st
1717
MONEY-19,500.43
1818
ORG-20,Wells Fargo
1919
MONEY-21,500
20-
PERSON-22,Dec-23
21-
CARDINAL-23,three
22-
CARDINAL-24,412
23-
ORG-26,PIN
24-
CARDINAL-27,four
25-
TIME-28,11:59 AM
26-
DATE-29,August 11th
27-
PERCENT-31,100%
20+
CARDINAL-22,three
21+
CARDINAL-23,412
22+
ORG-25,PIN
23+
CARDINAL-26,four
24+
TIME-27,11:59 AM
25+
DATE-28,August 11th
26+
PERCENT-30,100%
27+
CARDINAL-31,23
2828
CARDINAL-32,Oh
2929
CARDINAL-33,one

test/text_output_anonymized_l2.csv

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,44 @@ conversation_id,speaker,date_time,text
22
1011432,Agent,11/08/2019 00:00,Hello and thank you for contacting General Corporation. Before we start may I have your first and last name?
33
1011432,Client,11/08/2019 00:00,Eduardo Sheryl
44
1011432,Agent,11/08/2019 00:00,And what is your account number?
5-
1011432,Client,11/08/2019 00:00,It's 222-226-9870 I think.
5+
1011432,Client,11/08/2019 00:00,It's 231-222-1416 I think.
66
1011432,Agent,11/08/2019 00:00,And your social security number?
7-
1011432,Client,11/08/2019 00:00,It's 740-38-8174.
7+
1011432,Client,11/08/2019 00:00,It's 632-13-9644.
88
1011432,Agent,11/08/2019 00:00,And what is your email address?
9-
1011432,Client,11/08/2019 00:00,It's Amelia@hotmail.com
9+
1011432,Client,11/08/2019 00:00,It's Marlyn@msn.com
1010
1011432,Agent,11/08/2019 00:00,Thank you Eduardo. How may I help you today?
1111
1011432,Client,11/08/2019 00:00,I'm trying to pay my bill but it's not working.
1212
1011432,Agent,11/08/2019 00:00,Ok is this the 1st time you've tried to make the payment?
1313
1011432,Client,11/08/2019 00:00,yes
1414
1011432,Agent,11/08/2019 00:00,I can help you with that. Are you trying to pay with a bank draft or a credit card?
1515
1011432,Client,11/08/2019 00:00,I'm paying with my debit card.
1616
1011432,Agent,11/08/2019 00:00,What amount are you trying to pay?
17-
1011432,Client,11/08/2019 00:00,$44
17+
1011432,Client,11/08/2019 00:00,$6
1818
1011432,Agent,11/08/2019 00:00,What is the name of the bank for your debit card?
19-
1011432,Client,11/08/2019 00:00,Sorry I meant $912.58 even. My bank is Wells Fargo.
19+
1011432,Client,11/08/2019 00:00,Sorry I meant $5.24 even. My bank is Wells Fargo.
2020
1011432,Agent,11/08/2019 00:01,Can you please confirm the debit card number for me please?
21-
1011432,Client,11/08/2019 00:01,It's 3731-066907-39150
21+
1011432,Client,11/08/2019 00:01,It's 3763-706690-43915
2222
1011432,Agent,11/08/2019 00:01,and the expiration?
23-
1011432,Client,11/08/2019 00:01,Amelie
23+
1011432,Client,11/08/2019 00:01,Dec-23
2424
1011432,Agent,11/08/2019 00:01,And the CV code?
2525
1011432,Client,11/08/2019 00:01,What is that?
2626
1011432,Agent,11/08/2019 00:01,It's a three digit number usually on the back of your debit card next to the signature strip.
27-
1011432,Client,11/08/2019 00:01,Oh ok. It's 7812 or 412
27+
1011432,Client,11/08/2019 00:01,Oh ok. It's 2585 or 412
2828
1011432,Agent,11/08/2019 00:01,When did you want the payment to process?
2929
1011432,Client,11/08/2019 00:01,Can you make the payment process tomorrow please?
30-
1011432,Agent,11/08/2019 00:01,Do I have your authorization to run your debit card in the amount of $912.58?
30+
1011432,Agent,11/08/2019 00:01,Do I have your authorization to run your debit card in the amount of $5.24?
3131
1011432,Client,11/08/2019 00:01,Yes.
3232
1011432,Agent,11/08/2019 00:02,Ok one moment please while I run your debit card.
3333
1011432,Client,11/08/2019 00:02,Ok
3434
1011432,Agent,11/08/2019 00:03,The system is telling me that it needs your physical address associated with the card.
35-
1011432,Client,11/08/2019 00:04,Ok. It's 353 Copenhill Rd tes. The zip is 49272 or 49274.
35+
1011432,Client,11/08/2019 00:04,Ok. It's 160 Imperial St tes. The zip is 49268 or 49272.
3636
1011432,Agent,11/08/2019 00:05,I also need a phone number associated with the account.
37-
1011432,Client,11/08/2019 00:06,It’s probably my cell phone. That's 209-590-4548. It could also be my land line which is 632-943-1475
37+
1011432,Client,11/08/2019 00:06,It’s probably my cell phone. That's 865-754-1150. It could also be my land line which is 590-902-4548
3838
1011432,Agent,11/08/2019 00:06,And what is your four digit PIN code?
39-
1011432,Client,11/08/2019 00:06,I believe it's 7070. Or it could be 2283
39+
1011432,Client,11/08/2019 00:06,I believe it's 8128. Or it could be 7070
4040
1011432,Agent,11/08/2019 00:06,Thank you for that information. I will try running the transaction again.
4141
1011432,Client,11/08/2019 00:07,Ok thanks.
42-
1011432,Agent,11/08/2019 00:08,The payment was successful. You should get an email confirmation that a payment in the amount of $912.58 was made on August 11th at 11:59 AM. Is there anything else I can help you with?
42+
1011432,Agent,11/08/2019 00:08,The payment was successful. You should get an email confirmation that a payment in the amount of $5.24 was made on August 11th at 11:59 AM. Is there anything else I can help you with?
4343
1011432,Client,11/08/2019 00:09,And you're 100% sure it went through?
4444
1011432,Agent,11/08/2019 00:09,Yes the payment was successful.
4545
1011432,Client,11/08/2019 00:10,Nope that's it.

test/text_output_l2.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ conversation_id,speaker,date_time,text
2020
1011432,Agent,11/08/2019 00:01,Can you please confirm the debit card number for me please?
2121
1011432,Client,11/08/2019 00:01,It's [CCARD-6]
2222
1011432,Agent,11/08/2019 00:01,and the expiration?
23-
1011432,Client,11/08/2019 00:01,[PERSON-19]
23+
1011432,Client,11/08/2019 00:01,Dec-23
2424
1011432,Agent,11/08/2019 00:01,And the CV code?
2525
1011432,Client,11/08/2019 00:01,What is that?
2626
1011432,Agent,11/08/2019 00:01,It's a three digit number usually on the back of your debit card next to the signature strip.

test/text_output_l3.csv

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ conversation_id,speaker,date_time,text
2020
1011432,Agent,11/08/2019 00:01,Can you please confirm the debit card number for me please?
2121
1011432,Client,11/08/2019 00:01,It's [CCARD-6]
2222
1011432,Agent,11/08/2019 00:01,and the expiration?
23-
1011432,Client,11/08/2019 00:01,[PERSON-22]
23+
1011432,Client,11/08/2019 00:01,Dec-[CARDINAL-31]
2424
1011432,Agent,11/08/2019 00:01,And the CV code?
2525
1011432,Client,11/08/2019 00:01,What is that?
26-
1011432,Agent,11/08/2019 00:01,It's a [CARDINAL-23] digit number usually on the back of your debit card next to the signature strip.
27-
1011432,Client,11/08/2019 00:01,[CARDINAL-32] ok. It's <CVV/> or [CARDINAL-24]
26+
1011432,Agent,11/08/2019 00:01,It's a [CARDINAL-22] digit number usually on the back of your debit card next to the signature strip.
27+
1011432,Client,11/08/2019 00:01,[CARDINAL-32] ok. It's <CVV/> or [CARDINAL-23]
2828
1011432,Agent,11/08/2019 00:01,When did you want the payment to process?
2929
1011432,Client,11/08/2019 00:01,Can you make the payment process tomorrow please?
3030
1011432,Agent,11/08/2019 00:01,Do I have your authorization to run your debit card in the amount of [MONEY-21]?
@@ -35,12 +35,12 @@ conversation_id,speaker,date_time,text
3535
1011432,Client,11/08/2019 00:04,Ok. It's [ADDRESS-5] tes. The zip is [ZIP-11] or <ZIP/>.
3636
1011432,Agent,11/08/2019 00:05,I also need a phone number associated with the account.
3737
1011432,Client,11/08/2019 00:06,It’s probably my cell phone. That's [PHONE-9]. It could also be my land line which is [PHONE-8]
38-
1011432,Agent,11/08/2019 00:06,And what is your [CARDINAL-27] digit [ORG-26] code?
38+
1011432,Agent,11/08/2019 00:06,And what is your [CARDINAL-26] digit [ORG-25] code?
3939
1011432,Client,11/08/2019 00:06,I believe it's <PIN/>. Or it could be [PIN-13]
4040
1011432,Agent,11/08/2019 00:06,Thank you for that information. I will try running the transaction again.
4141
1011432,Client,11/08/2019 00:07,Ok thanks.
42-
1011432,Agent,11/08/2019 00:08,The payment was successful. You should get an email confirmation that a payment in the amount of [MONEY-21] was made on [DATE-29] at [TIME-28]. Is there anything else I can help you with?
43-
1011432,Client,11/08/2019 00:09,And you're [PERCENT-31] sure it went through?
42+
1011432,Agent,11/08/2019 00:08,The payment was successful. You should get an email confirmation that a payment in the amount of [MONEY-21] was made on [DATE-28] at [TIME-27]. Is there anything else I can help you with?
43+
1011432,Client,11/08/2019 00:09,And you're [PERCENT-30] sure it went through?
4444
1011432,Agent,11/08/2019 00:09,Yes the payment was successful.
4545
1011432,Client,11/08/2019 00:10,Nope that's it.
4646
1011432,Agent,11/08/2019 00:10,

test/voice_log_l2.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PHONE-2, one two four nine eight seven four six two three
44
SSN-3,two three four two three two three four three
55
EMAIL-4,eisen@discourse.ai
66
PERSON-6,David
7-
MONEY-8,three cents
7+
MONEY-8,fourty three cents
88
MONEY-9,Five hundred dollars
99
_IGNORE_-10,CV
1010
_IGNORE_-12,tomorrow

test/voice_log_l3.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ PIN-12,one one six eight
1313
ORG-13,General Corporation
1414
PERSON-15,David
1515
ORDINAL-17,first
16-
MONEY-18,three cents
16+
MONEY-18,fourty three cents
1717
MONEY-19,Five hundred dollars
1818
ORG-20,Wells Fargo
1919
CARDINAL-21,five hundred
@@ -24,8 +24,8 @@ MONEY-25,five hundred dollars
2424
GPE-26,the United States
2525
GPE-27,Deluth Georgia
2626
ORG-29,PIN
27-
TIME-31,eleven fifty nine AM
28-
DATE-32,August eleventh
27+
QUANTITY-31,eleven fifty nine AM
28+
EVENT-32,August eleventh
2929
PERCENT-34,one hundred percent
3030
CARDINAL-35,two
3131
CARDINAL-36,one

0 commit comments

Comments
 (0)