שיפור המודל שאומן מראש באמצעות נתוני אירועים של לקוחות

Cloud Talent Solution הוא שירות שמשלב למידת מכונה בחוויית חיפוש העבודה שלכם, ומחזיר תוצאות באיכות גבוהה לחיפוש עבודה, הרבה מעבר למגבלות של שיטות טיפוסיות שמבוססות על מילות מפתח. מייד אחרי ההתקנה, CTS מחיל מודלים של רלוונטיות ואונטולוגיות של משרות/כישורים על פרטי המשרה. כדי לשפר את התוצאות שמוצגות למחפשי עבודה, אתם יכולים לתעד אירועים של לקוחות על סמך הפעילות של מחפשי העבודה.

הקלטת אירועים בצד הלקוח באמצעות createClientEventRequest

כשמחפשי עבודה מבצעים פעולה ספציפית, אתם יכולים להשתמש בחיפוש העבודה כדי לתעד את הפעולה הזו. לדוגמה, אם מחפש העבודה או ישות אחרת שמקיימת אינטראקציה עם השירות צפה במשרה (או ברשימת משרות) בתצוגה שלו, למשל ברשימת תוצאות חיפוש בפורמט דחוס או חתוך. אתם יכולים לשלוח אירוע IMPRESSION (חשיפה) ל-Cloud Talent Solution כדי לספק נתונים על ההקשר של החיפוש והתוצאות שמועמדים יכולים לראות. כאשר מחפש העבודה לוחץ על תוצאת חיפוש של משרה כדי לראות את תיאור המשרה המלא, אתם יכולים לשלוח אירוע VIEW שמתעד את ההתעניינות של מחפש העבודה במשרה שנבחרה.

בדוגמה הבאה מוצג איך לשלוח הודעה ל-Cloud Talent Solution באמצעות API. המועמד למשרה או ישות אחרת שמקיימים אינטראקציה עם השירות ראו משרה (או רשימה של משרות) בפורמט דחוס או חתוך, למשל ברשימה של תוצאות חיפוש. האירוע הזה משויך בדרך כלל למחפשי עבודה שצופים ברשימת משרות בדף יחיד.

Go

מידע על התקנת ספריית הלקוח של CTS ושימוש בה מופיע במאמר ספריות הלקוח של CTS. מידע נוסף מופיע במאמרי העזרה של CTS Go API.

כדי לבצע אימות ב-CTS, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

import (
	"context"
	"fmt"
	"io"
	"time"

	talent "cloud.google.com/go/talent/apiv4beta1"
	"cloud.google.com/go/talent/apiv4beta1/talentpb"
	"github.com/golang/protobuf/ptypes"
)

// createClientEvent creates a client event.
func createClientEvent(w io.Writer, projectID string, requestID string, eventID string, relatedJobNames []string) (*talentpb.ClientEvent, error) {
	ctx := context.Background()

	// Create an eventService client.
	c, err := talent.NewEventClient(ctx)
	if err != nil {
		return nil, fmt.Errorf("talent.NewEventClient: %w", err)
	}
	defer c.Close()

	createTime, _ := ptypes.TimestampProto(time.Now())
	clientEventToCreate := &talentpb.ClientEvent{
		RequestId:  requestID,
		EventId:    eventID,
		CreateTime: createTime,
		Event: &talentpb.ClientEvent_JobEvent{
			JobEvent: &talentpb.JobEvent{
				Type: talentpb.JobEvent_VIEW,
				Jobs: relatedJobNames,
			},
		},
	}

	// Construct a createJob request.
	req := &talentpb.CreateClientEventRequest{
		Parent:      fmt.Sprintf("projects/%s", projectID),
		ClientEvent: clientEventToCreate,
	}

	resp, err := c.CreateClientEvent(ctx, req)
	if err != nil {
		return nil, fmt.Errorf("CreateClientEvent: %w", err)
	}

	fmt.Fprintf(w, "Client event created: %v\n", resp.GetEvent())

	return resp, nil
}

Java

מידע על התקנת ספריית הלקוח של CTS ושימוש בה מופיע במאמר ספריות הלקוח של CTS. מידע נוסף מופיע במאמרי העזרה של CTS Java API.

כדי לבצע אימות ב-CTS, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.


import com.google.cloud.talent.v4beta1.ClientEvent;
import com.google.cloud.talent.v4beta1.CreateClientEventRequest;
import com.google.cloud.talent.v4beta1.EventServiceClient;
import com.google.cloud.talent.v4beta1.JobEvent;
import com.google.cloud.talent.v4beta1.TenantName;
import com.google.protobuf.Timestamp;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

public class JobSearchCreateClientEvent {

  public static void createClientEvent() throws IOException {
    // TODO(developer): Replace these variables before running the sample.
    String projectId = "your-project-id";
    String tenantId = "your-tenant-id";
    String requestId = "your-req-id-from-response-metadata";
    String eventId = "your-unique-identifier-id";
    createClientEvent(projectId, tenantId, requestId, eventId);
  }

  // Creates a client event.
  public static void createClientEvent(
      String projectId, String tenantId, String requestId, String eventId) throws IOException {
    // Initialize client that will be used to send requests. This client only needs to be created
    // once, and can be reused for multiple requests. After completing all of your requests, call
    // the "close" method on the client to safely clean up any remaining background resources.
    try (EventServiceClient eventServiceClient = EventServiceClient.create()) {
      TenantName parent = TenantName.of(projectId, tenantId);

      // The timestamp of the event as seconds of UTC time since Unix epoch
      // For more information on how to create google.protobuf.Timestamps
      // See:
      // https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto
      long seconds = 3L;
      Timestamp createTime = Timestamp.newBuilder().setSeconds(seconds).build();

      // The type of event attributed to the behavior of the end user
      JobEvent.JobEventType type = JobEvent.JobEventType.VIEW;

      // List of job names associated with this event
      String jobsElement = "projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]";
      String jobsElement2 = "projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]";

      List<String> jobs = Arrays.asList(jobsElement, jobsElement2);
      JobEvent jobEvent = JobEvent.newBuilder().setType(type).addAllJobs(jobs).build();
      ClientEvent clientEvent =
          ClientEvent.newBuilder()
              .setRequestId(requestId)
              .setEventId(eventId)
              .setCreateTime(createTime)
              .setJobEvent(jobEvent)
              .build();
      CreateClientEventRequest request =
          CreateClientEventRequest.newBuilder()
              .setParent(parent.toString())
              .setClientEvent(clientEvent)
              .build();
      ClientEvent response = eventServiceClient.createClientEvent(request);
      System.out.println("Created client event. ");
      System.out.println(response.toString());
    }
  }
}

Node.js

מידע על התקנת ספריית הלקוח של CTS ושימוש בה מופיע במאמר ספריות הלקוח של CTS. מידע נוסף מופיע במאמרי העזרה של CTS Node.js API.

כדי לבצע אימות ב-CTS, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.


const talent = require('@google-cloud/talent').v4;

/**
 * Creates a client event
 *
 * @param projectId {string} Your Google Cloud Project ID
 * @param tenantId {string} Identifier of the Tenant
 * @param requestId {string} A unique ID generated in the API responses.
 * Value should be set to the request_id from an API response.
 * @param eventId {string} A unique identifier, generated by the client application
 */
function sampleCreateClientEvent(projectId, tenantId, requestId, eventId) {
  const client = new talent.EventServiceClient();
  // const projectId = 'Your Google Cloud Project ID';
  // const tenantId = 'Your Tenant ID (using tenancy is optional)';
  // const requestId = '[request_id from ResponseMetadata]';
  // const eventId = '[Set this to a unique identifier]';
  const formattedParent = client.tenantPath(projectId, tenantId);

  // The timestamp of the event as seconds of UTC time since Unix epoch
  // For more information on how to create google.protobuf.Timestamps
  // See: https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto
  const seconds = 0;
  const createTime = {
    seconds: seconds,
  };

  // The type of event attributed to the behavior of the end user
  const type = 'VIEW';

  // List of job names associated with this event
  const jobsElement = 'projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]';
  const jobsElement2 =
    'projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]';
  const jobs = [jobsElement, jobsElement2];
  const jobEvent = {
    type: type,
    jobs: jobs,
  };
  const clientEvent = {
    requestId: requestId,
    eventId: eventId,
    createTime: createTime,
    jobEvent: jobEvent,
  };
  const request = {
    parent: formattedParent,
    clientEvent: clientEvent,
  };
  client
    .createClientEvent(request)
    .then(responses => {
      const response = responses[0];
      console.log('Created client event');
      console.log(`Response: ${response}`);
    })
    .catch(err => {
      console.error(err);
    });
}

Python

מידע על התקנת ספריית הלקוח של CTS ושימוש בה מופיע במאמר ספריות הלקוח של CTS. מידע נוסף מופיע במאמרי העזרה של CTS Python API.

כדי לבצע אימות ב-CTS, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.


from google.cloud import talent
from google.cloud.talent import enums


def create_client_event(project_id, tenant_id, request_id, event_id):
    """
    Creates a client event

    Args:
      project_id Your Google Cloud Project ID
      tenant_id Identifier of the Tenant
      request_id A unique ID generated in the API responses.
      Value should be set to the request_id from an API response.
      event_id A unique identifier, generated by the client application
    """

    client = talent.EventServiceClient()

    # project_id = 'Your Google Cloud Project ID'
    # tenant_id = 'Your Tenant ID (using tenancy is optional)'
    # request_id = '[request_id from ResponseMetadata]'
    # event_id = '[Set this to a unique identifier]'

    if isinstance(project_id, bytes):
        project_id = project_id.decode("utf-8")
    if isinstance(tenant_id, bytes):
        tenant_id = tenant_id.decode("utf-8")
    if isinstance(request_id, bytes):
        request_id = request_id.decode("utf-8")
    if isinstance(event_id, bytes):
        event_id = event_id.decode("utf-8")
    parent = f"projects/{project_id}/tenants/{tenant_id}"

    # The timestamp of the event as seconds of UTC time since Unix epoch
    # For more information on how to create google.protobuf.Timestamps
    # See:
    # https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto
    seconds = 0
    create_time = {"seconds": seconds}

    # The type of event attributed to the behavior of the end user
    type_ = enums.JobEvent.JobEventType.VIEW

    # List of job names associated with this event
    jobs_element = "projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]"
    jobs_element_2 = "projects/[Project ID]/tenants/[Tenant ID]/jobs/[Job ID]"
    jobs = [jobs_element, jobs_element_2]
    job_event = {"type": type_, "jobs": jobs}
    client_event = {
        "request_id": request_id,
        "event_id": event_id,
        "create_time": create_time,
        "job_event": job_event,
    }

    response = client.create_client_event(parent=parent, client_event=client_event)
    print(response)

הודעות על אירועים

שדות חובה:

  • eventId (מוגדר על ידי הלקוח): לכל הודעה שנשלחת אל Cloud Talent Solution צריך להיות eventId ייחודי. מומלץ לשלב את חותמת הזמן בהגדרת השדה הזה כדי למנוע כפילויות. האורך המקסימלי של השדה הזה הוא 255 תווים.

  • requestId: הערך של requestId שמוחזר על ידי אובייקט תגובת החיפוש. הערך הזה ייחודי לקריאה מסוימת ל-API של SearchJobsRequest. הוא משמש לכל ההודעות הבאות שנובעות מאירוע החשיפה המקורי של החיפוש. כשמתבצעת קריאה חדשה ל-API של SearchJobsRequest (לדוגמה: מחפש עבודה עובר לדף הבא של התוצאות), הערך של requestId משתנה.

  • createTime חותמת הזמן של האירוע (בפורמט Timestamp, ברמת דיוק של ננו-שניות). חותמת הזמן הזו צריכה לשקף את הזמן שבו האירוע התרחש בפועל, ולא את הזמן שבו ההודעה נשלחה.

  • אובייקטים של שדה איחוד event: jobEvent משמשים בתכונה 'חיפוש עבודה' ומונפקים כשמחפשי עבודה יוצרים אינטראקציה עם השירות.

הודעה לדוגמה על אירוע

הקריאה ל-API בדוגמת הקוד שלמעלה אמורה ליצור הודעת JSON בפורמט הבא:

JSON

{
  "requestId": string,
  "eventId": string,
  "createTime": string,
  "eventNotes": string,

// Union field event can be only be a jobEvent: "jobEvent": { object (JobEvent) }, // End of list of possible types for union field event. }

תרחישים ותהליכי עבודה

בהמשך מפורטים שני תרחישים לדוגמה של חיפוש משרה, צפייה בה והגשת מועמדות למשרה.

Workflow 1

  1. מחפש עבודה מבצע חיפוש. לדוגמה: Product mgr SF

    תוצאות החיפוש מוחזרות למחפש העבודה.

    אובייקט התגובה של חיפוש המשרות שנשלח בחזרה לשרת של הלקוח מכיל requestId ייחודי (לדוגמה: requestId). צריך להשתמש ב-requestId הזה בכל ההודעות העתידיות שקשורות לקריאה הספציפית הזו ל-API של SearchJobsRequest.8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==

    שליחת הודעת IMPRESSION אל Cloud Talent Solution.

    הודעה לדוגמה על אירוע:

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID1",
      "createTime": "2018-12-19T16:39:57-08:00",
      "jobEvent":
      {"type":"IMPRESSION",
      "jobs":["jobs/4000000000", "jobs/4000000001","jobs/4000000002",
      "jobs/4000000003", "jobs/4000000004"]}
    }
    
  2. מחפש העבודה בוחר תוצאה (פרסום משרה) כדי לראות את הפרטים המלאים של המשרה.

    שולחים ל-Cloud Talent Solution הודעת צפייה.

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID2",
      "createTime": "2018-12-19T16:40:57-08:00",
      "jobEvent":
      {"type":"VIEW",
      "jobs":["jobs/4000000000"]}
    
    }
    
  3. מחפש עבודה מגיש מועמדות לפרסום המשרה שבה צפה.

    א. אם המועמד מועבר לדף באותו דומיין (דף פנימי של אפליקציית הגיוס), צריך לשלוח ל-Cloud Talent Solution הודעה מסוג APPLICATION_START.

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID3",
      "createTime": "2018-12-19T16:41:57-08:00",
      "jobEvent":
      {"type":"APPLICATION_START",
    "jobs":["jobs/4000000000"]}
    }
    

    ב. אם המועמד מועבר לדף חיצוני של אפליקציה, שולחים ל-Cloud Talent Solution הודעה מסוג APPLICATION_REDIRECT.

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID3",
      "createTime": "2018-12-19T16:41:57-08:00",
      "jobEvent":
      {"type":"APPLICATION_REDIRECT",
      "jobs":["jobs/4000000000"]}
    
    }
    
  4. כשמחפש העבודה משלים טופס בקשה פנימי, צריך לשלוח ל-Cloud Talent Solution הודעה מסוג APPLICATION_FINISH:

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID4",
      "createTime": "2018-12-19T16:43:57-08:00",
      "jobEvent":
      {"type":"APPLICATION_FINISH",
      "jobs":["jobs/4000000000"]}
    
    }
    
  5. מחפש העבודה חוזר לתוצאות החיפוש וממשיך לדף 2 (או שהוא ממשיך לדף 2 בלי ללחוץ על פרסום משרה).

    שליחת הודעת IMPRESSION אל Cloud Talent Solution עם קבוצת התוצאות הבאה מדף 2. הערה: יש requestId חדש שנוצר בתגובה לקריאה ל-API‏ SearchJobsRequest שיוצרת את הדף השני של התוצאות. (לדוגמה, 99e5b99c-f1ba-4f85-b17d-ccf878f451f9:APAb7IRESj+/Hzwa3bBd54P3qPx2yOWm5w==).

    {
      "requestId": "99e5b99c-f1ba-4f85-b17d-ccf878f451f9:APAb7IRESj+/Hzwa3bBd54P3qPx2yOWm5w==",
      "eventId": "ID5",
      "createTime": "2018-12-19T18:39:57-08:00",
      "jobEvent":
      {"type":"IMPRESSION",
      "jobs":["jobs/4000000005", "jobs/4000000006","jobs/4000000007",
      "jobs/4000000008", "jobs/4000000009"]}
    }
    
  6. המחפש ממשיך לדף 3 של תוצאות החיפוש.

    שולחים ל-Cloud Talent Solution הודעה מסוג IMPRESSION עם קבוצת התוצאות הבאה. הערה: יש לך יצירה חדשה (requestId), למשל e2d2b916-78c3-4c65-aecc-d8452bc0afb0:APAb7IRvCsNPiRXYkgF8PN5e8BkbFzKOyg==.

    {
      "requestId": "e2d2b916-78c3-4c65-aecc-d8452bc0afb0:APAb7IRvCsNPiRXYkgF8PN5e8BkbFzKOyg==",
      "eventId": "ID6",
      "createTime": "2018-12-19T16:41:57-08:00",
      "jobEvent":
      {"type":"IMPRESSION",
      "jobs":["jobs/4000000010", "jobs/4000000011","jobs/4000000012",
      "jobs/400000013", "jobs/4000000014"]}
    }
    

תהליך עבודה 2

  1. מחפש עבודה מבצע חיפוש. לדוגמה: Product mgr SF

    תוצאות החיפוש מוחזרות למחפש העבודה.

    אובייקט התגובה של חיפוש המשרות מכיל מזהה ייחודי requestId (לדוגמה: a2179a9b-cf73-413e-8076-98af08b991ad). משתמשים במזהה requestId הזה לכל ההודעות העתידיות שקשורות לקריאה הזו ל-API של SearchJobsRequest.

    שליחת הודעת IMPRESSION אל Cloud Talent Solution.

    {
      "requestId": "a2179a9b-cf73-413e-8076-98af08b991ad",
      "eventId": "ID1",
      "createTime": "2018-12-19T16:39:57-08:00",
      "jobEvent":
      {"type":"IMPRESSION",
      "jobs":["jobs/4000000000", "jobs/4000000001","jobs/4000000002",
      "jobs/4000000003", "jobs/4000000004"]}
    }
    
  2. מחפש העבודה בוחר תוצאה (פרסום משרה) כדי לראות את הפרטים המלאים של המשרה.

    שולחים ל-Cloud Talent Solution הודעת צפייה.

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID2",
      "createTime": "2018-12-19T16:40:57-08:00",
      "jobEvent":
      {"type":"VIEW",
      "jobs":["jobs/4000000000"]}
    }
    
  3. מחפש עבודה שולח בקשת מועמדות למשרה בקליק אחד, כמו שמתואר בAPPLICATION_QUICK_SUBMISSION.

    שליחת הודעה מסוג APPLICATION_QUICK_SUBMISSION אל Cloud Talent Solution עם קבוצת התוצאות הבאה.

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID3",
      "createTime": "2018-12-19T16:41:57-08:00",
      "jobEvent":
      {"type":"APPLICATION_QUICK_SUBMISSION",
      "jobs":["jobs/4000000000"]}
     }
    
  4. מחפש העבודה מבצע את הפעולות הבאות.

    א. מחפש העבודה חוזר לתוצאות החיפוש ומגיש מועמדות למשרה ישירות מדף תוצאות החיפוש. תהליך הגשת הבקשה ארוך יותר מזה שמוגדר ב-APPLICATION_QUICK_SUBMISSION (כלומר, זהו תהליך הגשת בקשה רב-שלבי).

    שליחת הודעה מסוג APPLICATION_START_FROM_SERP אל Cloud Talent Solution.

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID4",
      "createTime": "2018-12-19T16:43:57-08:00",
      "jobEvent":
      {"type":"APPLICATION_START_FROM_SERP",
      "jobs":["jobs/4000000000"]}
    }
    

    ב. מחפש העבודה משלים את תהליך הגשת המועמדות למשרה. שליחת הודעה מסוג APPLICATION_FINISH אל Cloud Talent Solution.

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID5",
      "createTime": "2018-12-19T16:44:57-08:00",
      "jobEvent":
      {"type":"APPLICATION_FINISH",
      "jobs":["jobs/4000000000"]}
    }
    
  5. מחפש העבודה חוזר לתוצאות החיפוש ושולח בקשה למשרה ישירות מדף תוצאות החיפוש. תהליך הגשת המועמדות מפנה את מחפשי העבודה לדומיין אחר שנמצא מחוץ לאתר הדייר (בקשה חיצונית), ולכן אי אפשר לעקוב אחרי התקדמות המועמד.

    שליחת הודעה מסוג APPLICATION_REDIRECT_FROM_SERP אל Cloud Talent Solution.

    {
      "requestId": "8d2bdd5d-1361-42a5-a0fd-bd2b58b7d8fb:APAb7ISd4Sc5faibw2V5hTU/OoC2WAW5AA==",
      "eventId": "ID6",
      "createTime": "2018-12-19T16:45:57-08:00",
      "jobEvent":
      {"type":"APPLICATION_START_FROM_SERP",
      "jobs":["jobs/4000000001"]}
    }
    

    זה שונה מ-APPLICATION_REDIRECT, שבו מחפשי עבודה נמצאים בדף תיאור המשרה כשהם מנותבים מחדש.

אימות ההטמעה של אירועים בצד הלקוח

‫Cloud Talent Solution מספק לכם כלים בשירות עצמי שבהם אתם יכולים להשתמש כדי לאמת את ההטמעה של אירועי לקוח. מידע נוסף על אפשרויות השירות העצמי הזמינות מופיע במאמר בנושא כלי ניהול.