Skip to content

Commit

Permalink
some P7 project file
Browse files Browse the repository at this point in the history
Gonna move this soon
  • Loading branch information
Patent2net committed Jan 6, 2021
1 parent 9ad1b51 commit 3fc80cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
9 changes: 5 additions & 4 deletions Patent2Net/PreScriptP7.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# script to filter and normalize name. P2N do these steps alone now. Corpora spliter is then called

$scriptPath = "REQ-P7"
$Reps = "REQ-P7"
$scriptPath = (-join('..\', $scriptPath, '\'))
$filename = Get-ChildItem (-join('..\', $scriptPath, '\'))
# foreach ($f in $filename) {python PatentListFiltering.py (-join('..\', $scriptPath, '\',$f))}
# foreach ($f in $filename) {python preProcessNormalisationNames.py (-join('..\', $scriptPath, '\',$f))}
foreach ($f in $filename) {python SplitCorpus2.py (-join('..\', $scriptPath, '\',$f))}
# foreach ($f in $filename) {python PatentListFiltering.py (-join('..\', $scriptPath, '\',$f))}
foreach ($f in $filename) {python preProcessNormalisationNames.py (-join('..\', $scriptPath, '\',$f))}
foreach ($f in $filename) {python SplitCorpus2.py (-join('..\', $scriptPath, '\',$f))}
8 changes: 4 additions & 4 deletions Patent2Net/SplitCorpus2.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@
elif isinstance(bre['applicant'], str):
if bre['applicant'].upper() in Public:
bre ['type'] = "public"
bre['typeCollab'] ="NON" # one applicant, no collaboration
bre['typeCollab'] ="NON" # one applicant public, no collaboration
else:
bre ['type'] = "indus"
bre['typeCollab'] = "NON" # one applicant, no collaboration
elif isinstance(bre['applicant'], list) and len(bre['applicant'])>1 and CheckListExclu(bre['applicant'], Inventeurs):
if CheckListInclu(bre['applicant'], Public): # one public entity
bre ['type'] = "public"
bre['typeCollab'] = [ApplType[truc] for truc in bre['applicant']]
bre['c'] = [ApplType[truc] for truc in bre['applicant']]
elif CheckListExclu(bre['applicant'], Public): # no public entity
bre ['type'] = "indus"
bre['typeCollab'] = "indus"
Expand All @@ -236,7 +236,7 @@
bre['typeCollab'] = "indus-individu"
else: # all applicants are inventors !!
bre ['type'] = "individuels"
bre['typeCollab'] = "individuels"
bre['typeCollab'] = "Inconnu"


# elif len(bre['applicant'])>0:
Expand Down Expand Up @@ -275,7 +275,7 @@
AutInvDeposant = [bre for bre in LstBrevet if bre['type'] == 'Inconnu']
#check consistance
total = len(Mix) + len(Univ) + len(Indus) + len(AutInvDeposant)
if total == 0:
if total-len(LstBrevet) == 0:
print (total -len(LstBrevet)), " patents left... GOOD"

projectNameMix=projectName+'Mix'
Expand Down
3 changes: 1 addition & 2 deletions Patent2Net/preProcessNormalisationNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@

for bre in LstBrevet:#[:alpha]:
memo = copy.copy(bre['inventor'])
if bre['label'] == 'FR3007658':
print (bre)

bre['inventor'] = Nettoie(list(set(bre['inventor'])))
if isinstance(bre['inventor'], list) and len(bre['inventor'])>1 and ''.join(memo).lower() != 'empty':
for inv in bre['inventor']:
Expand Down

0 comments on commit 3fc80cf

Please sign in to comment.