Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plan refactoring of file-directory architecture #54

Open
athityakumar opened this issue Mar 16, 2019 · 2 comments
Open

Plan refactoring of file-directory architecture #54

athityakumar opened this issue Mar 16, 2019 · 2 comments
Assignees
Labels
basic-need Things to be done, for MVP (Minimum Viable Product) best-practise Things to do, once the scripts are working enhancement New feature or request

Comments

@athityakumar
Copy link
Member

I'll try to collect all my thoughts about the repo structure here, over the next few days.

@athityakumar athityakumar added enhancement New feature or request best-practise Things to do, once the scripts are working basic-need Things to be done, for MVP (Minimum Viable Product) labels Mar 16, 2019
@athityakumar athityakumar self-assigned this Mar 16, 2019
@athityakumar
Copy link
Member Author

(This comment will probably undergo multiple editions)

deploy.sh
Dockerfile
README.md
LICENSE.md
CONTRIBUTION_GUIDELINES.md

.github/
  ISSUES_TEMPLATE.md
  PR_TEMPLATE.md

.gitignore
.env
.env_example

api/
  graph_formation.py # Merges all graph_formations/ scripts into one
  graph_io.py # Contains networkx-to-neo4j adapters to import graph to database
  sqlite3_adapter.py # Has all data to populate into sqlite3
  db_importer.py # One-time script to populate stuff into neo4j & sqlite databases
  endpoints.py # Handles different endpoints
  flask.py # Handle CORS?
  requirements.txt
  tox.ini

  backend/
    subgraph.py
    abbreviations.py

    graph_formation/ (One-time use only)
      base/
        legal_knowledge_graph.py # includes content of subgraph.py
        judge.py
        case.py
      add_judges.py
      add_key_and_catch_words.py
      add_acts.py
      add_cases.py
      network_analyser.py # Rank important nodes according to pagerank and store them as node attrs
      extract_mappings.py # (Case -> Case id -> Case filename),  (Act -> Year), called by other scripts
      # Probably better to store these mappings into sqlite3 one-time?

    nlp/    
      section_extractor.py
      timeline_extractor.pr
      summarizer.py
      tf_idf.py
      spellcheck.py # Used for both suggesting in front-end & spell-checking in back-end
      query_to_keywords.py
      query_vector_similarity.py
      dependency_parser.py # Processes query

  db_importer/
    mappings.py # Sqlite3
    graph.py # Neo4j
    act_sections.py # Sqlite3, section_id -> act_id -> section_name -> section_description
    acts.py # Sqlite3, act_id -> act_name -> act_year -> act_filepath -> act_state
    cases.py # Sqlite3

  endpoints/
    lawyer_search.py # Just uses subgraph.py
    layman_search.py # Uses nlp/ to extract keywords and then results from subgraph.py
    case.py # GET /cases/{id}
    judge.py # GET /judges/{id}
    act.py # GET /acts/{id}
    keyword.py # GET /keywords/{id}
    catchword.py # GET /catchwords/{id}
    datatable.py # Handle filtering, sort, and pagination

client/ (Yet to plan properly)

@athityakumar
Copy link
Member Author

While deploying:

run cd api; python3 db_importer.py to migrate all data into Mongo & Neo4j
run cd api; python3 flask.py to setup back-end
run cd client; yarn start to setup front-end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
basic-need Things to be done, for MVP (Minimum Viable Product) best-practise Things to do, once the scripts are working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant